001 package com.thaiopensource.relaxng.impl;
002
003 import org.xml.sax.Locator;
004 import com.thaiopensource.xml.util.Name;
005
006 class RestrictionViolationException extends Exception {
007 private final String messageId;
008 private Locator loc;
009 private Name name;
010
011 RestrictionViolationException(String messageId) {
012 this.messageId = messageId;
013 }
014
015 RestrictionViolationException(String messageId, Name name) {
016 this.messageId = messageId;
017 this.name = name;
018 }
019
020 String getMessageId() {
021 return messageId;
022 }
023
024 Locator getLocator() {
025 return loc;
026 }
027
028 void maybeSetLocator(Locator loc) {
029 if (this.loc == null)
030 this.loc = loc;
031 }
032
033 Name getName() {
034 return name;
035 }
036 }
037