下面列出了怎么用javax.xml.bind.helpers.ValidationEventLocatorImpl的API类实例代码及写法,或者点击链接到github查看源代码。
public String onIDREF( Object obj ) throws SAXException {
String id;
try {
id = getIdFromObject(obj);
} catch (JAXBException e) {
reportError(null,e);
return null; // recover by returning null
}
idReferencedObjects.add(obj);
if(id==null) {
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.NOT_IDENTIFIABLE.format(),
new ValidationEventLocatorImpl(obj) ) );
}
return id;
}
void reconcileID() throws SAXException {
// find objects that were not a part of the object graph
idReferencedObjects.removeAll(objectsWithId);
for( Object idObj : idReferencedObjects ) {
try {
String id = getIdFromObject(idObj);
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.DANGLING_IDREF.format(id),
new ValidationEventLocatorImpl(idObj) ) );
} catch (JAXBException e) {
// this error should have been reported already. just ignore here.
}
}
// clear the garbage
idReferencedObjects.clear();
objectsWithId.clear();
}
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
visitor.startDocument(new LocatorEx() {
public ValidationEventLocator getLocation() {
return new ValidationEventLocatorImpl(this);
}
public int getColumnNumber() {
return getCurrentLocation().getColumnNumber();
}
public int getLineNumber() {
return getCurrentLocation().getLineNumber();
}
public String getPublicId() {
return getCurrentLocation().getPublicId();
}
public String getSystemId() {
return getCurrentLocation().getSystemId();
}
},nsc);
}
public String onIDREF( Object obj ) throws SAXException {
String id;
try {
id = getIdFromObject(obj);
} catch (JAXBException e) {
reportError(null,e);
return null; // recover by returning null
}
idReferencedObjects.add(obj);
if(id==null) {
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.NOT_IDENTIFIABLE.format(),
new ValidationEventLocatorImpl(obj) ) );
}
return id;
}
void reconcileID() throws SAXException {
// find objects that were not a part of the object graph
idReferencedObjects.removeAll(objectsWithId);
for( Object idObj : idReferencedObjects ) {
try {
String id = getIdFromObject(idObj);
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.DANGLING_IDREF.format(id),
new ValidationEventLocatorImpl(idObj) ) );
} catch (JAXBException e) {
// this error should have been reported already. just ignore here.
}
}
// clear the garbage
idReferencedObjects.clear();
objectsWithId.clear();
}
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
visitor.startDocument(new LocatorEx() {
public ValidationEventLocator getLocation() {
return new ValidationEventLocatorImpl(this);
}
public int getColumnNumber() {
return getCurrentLocation().getColumnNumber();
}
public int getLineNumber() {
return getCurrentLocation().getLineNumber();
}
public String getPublicId() {
return getCurrentLocation().getPublicId();
}
public String getSystemId() {
return getCurrentLocation().getSystemId();
}
},nsc);
}
public String onIDREF( Object obj ) throws SAXException {
String id;
try {
id = getIdFromObject(obj);
} catch (JAXBException e) {
reportError(null,e);
return null; // recover by returning null
}
idReferencedObjects.add(obj);
if(id==null) {
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.NOT_IDENTIFIABLE.format(),
new ValidationEventLocatorImpl(obj) ) );
}
return id;
}
void reconcileID() throws SAXException {
// find objects that were not a part of the object graph
idReferencedObjects.removeAll(objectsWithId);
for( Object idObj : idReferencedObjects ) {
try {
String id = getIdFromObject(idObj);
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.DANGLING_IDREF.format(id),
new ValidationEventLocatorImpl(idObj) ) );
} catch (JAXBException e) {
// this error should have been reported already. just ignore here.
}
}
// clear the garbage
idReferencedObjects.clear();
objectsWithId.clear();
}
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
visitor.startDocument(new LocatorEx() {
public ValidationEventLocator getLocation() {
return new ValidationEventLocatorImpl(this);
}
public int getColumnNumber() {
return getCurrentLocation().getColumnNumber();
}
public int getLineNumber() {
return getCurrentLocation().getLineNumber();
}
public String getPublicId() {
return getCurrentLocation().getPublicId();
}
public String getSystemId() {
return getCurrentLocation().getSystemId();
}
},nsc);
}
public String onIDREF( Object obj ) throws SAXException {
String id;
try {
id = getIdFromObject(obj);
} catch (JAXBException e) {
reportError(null,e);
return null; // recover by returning null
}
idReferencedObjects.add(obj);
if(id==null) {
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.NOT_IDENTIFIABLE.format(),
new ValidationEventLocatorImpl(obj) ) );
}
return id;
}
void reconcileID() throws SAXException {
// find objects that were not a part of the object graph
idReferencedObjects.removeAll(objectsWithId);
for( Object idObj : idReferencedObjects ) {
try {
String id = getIdFromObject(idObj);
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.DANGLING_IDREF.format(id),
new ValidationEventLocatorImpl(idObj) ) );
} catch (JAXBException e) {
// this error should have been reported already. just ignore here.
}
}
// clear the garbage
idReferencedObjects.clear();
objectsWithId.clear();
}
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
visitor.startDocument(new LocatorEx() {
public ValidationEventLocator getLocation() {
return new ValidationEventLocatorImpl(this);
}
public int getColumnNumber() {
return getCurrentLocation().getColumnNumber();
}
public int getLineNumber() {
return getCurrentLocation().getLineNumber();
}
public String getPublicId() {
return getCurrentLocation().getPublicId();
}
public String getSystemId() {
return getCurrentLocation().getSystemId();
}
},nsc);
}
public String onIDREF( Object obj ) throws SAXException {
String id;
try {
id = getIdFromObject(obj);
} catch (JAXBException e) {
reportError(null,e);
return null; // recover by returning null
}
idReferencedObjects.add(obj);
if(id==null) {
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.NOT_IDENTIFIABLE.format(),
new ValidationEventLocatorImpl(obj) ) );
}
return id;
}
void reconcileID() throws SAXException {
// find objects that were not a part of the object graph
idReferencedObjects.removeAll(objectsWithId);
for( Object idObj : idReferencedObjects ) {
try {
String id = getIdFromObject(idObj);
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.DANGLING_IDREF.format(id),
new ValidationEventLocatorImpl(idObj) ) );
} catch (JAXBException e) {
// this error should have been reported already. just ignore here.
}
}
// clear the garbage
idReferencedObjects.clear();
objectsWithId.clear();
}
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
visitor.startDocument(new LocatorEx() {
public ValidationEventLocator getLocation() {
return new ValidationEventLocatorImpl(this);
}
public int getColumnNumber() {
return getCurrentLocation().getColumnNumber();
}
public int getLineNumber() {
return getCurrentLocation().getLineNumber();
}
public String getPublicId() {
return getCurrentLocation().getPublicId();
}
public String getSystemId() {
return getCurrentLocation().getSystemId();
}
},nsc);
}
public String onIDREF( Object obj ) throws SAXException {
String id;
try {
id = getIdFromObject(obj);
} catch (JAXBException e) {
reportError(null,e);
return null; // recover by returning null
}
idReferencedObjects.add(obj);
if(id==null) {
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.NOT_IDENTIFIABLE.format(),
new ValidationEventLocatorImpl(obj) ) );
}
return id;
}
void reconcileID() throws SAXException {
// find objects that were not a part of the object graph
idReferencedObjects.removeAll(objectsWithId);
for( Object idObj : idReferencedObjects ) {
try {
String id = getIdFromObject(idObj);
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.DANGLING_IDREF.format(id),
new ValidationEventLocatorImpl(idObj) ) );
} catch (JAXBException e) {
// this error should have been reported already. just ignore here.
}
}
// clear the garbage
idReferencedObjects.clear();
objectsWithId.clear();
}
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
visitor.startDocument(new LocatorEx() {
public ValidationEventLocator getLocation() {
return new ValidationEventLocatorImpl(this);
}
public int getColumnNumber() {
return getCurrentLocation().getColumnNumber();
}
public int getLineNumber() {
return getCurrentLocation().getLineNumber();
}
public String getPublicId() {
return getCurrentLocation().getPublicId();
}
public String getSystemId() {
return getCurrentLocation().getSystemId();
}
},nsc);
}
public String onIDREF( Object obj ) throws SAXException {
String id;
try {
id = getIdFromObject(obj);
} catch (JAXBException e) {
reportError(null,e);
return null; // recover by returning null
}
idReferencedObjects.add(obj);
if(id==null) {
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.NOT_IDENTIFIABLE.format(),
new ValidationEventLocatorImpl(obj) ) );
}
return id;
}
void reconcileID() throws SAXException {
// find objects that were not a part of the object graph
idReferencedObjects.removeAll(objectsWithId);
for( Object idObj : idReferencedObjects ) {
try {
String id = getIdFromObject(idObj);
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.DANGLING_IDREF.format(id),
new ValidationEventLocatorImpl(idObj) ) );
} catch (JAXBException e) {
// this error should have been reported already. just ignore here.
}
}
// clear the garbage
idReferencedObjects.clear();
objectsWithId.clear();
}
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
visitor.startDocument(new LocatorEx() {
public ValidationEventLocator getLocation() {
return new ValidationEventLocatorImpl(this);
}
public int getColumnNumber() {
return getCurrentLocation().getColumnNumber();
}
public int getLineNumber() {
return getCurrentLocation().getLineNumber();
}
public String getPublicId() {
return getCurrentLocation().getPublicId();
}
public String getSystemId() {
return getCurrentLocation().getSystemId();
}
},nsc);
}
public String onIDREF( Object obj ) throws SAXException {
String id;
try {
id = getIdFromObject(obj);
} catch (JAXBException e) {
reportError(null,e);
return null; // recover by returning null
}
idReferencedObjects.add(obj);
if(id==null) {
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.NOT_IDENTIFIABLE.format(),
new ValidationEventLocatorImpl(obj) ) );
}
return id;
}
void reconcileID() throws SAXException {
// find objects that were not a part of the object graph
idReferencedObjects.removeAll(objectsWithId);
for( Object idObj : idReferencedObjects ) {
try {
String id = getIdFromObject(idObj);
reportError( new NotIdentifiableEventImpl(
ValidationEvent.ERROR,
Messages.DANGLING_IDREF.format(id),
new ValidationEventLocatorImpl(idObj) ) );
} catch (JAXBException e) {
// this error should have been reported already. just ignore here.
}
}
// clear the garbage
idReferencedObjects.clear();
objectsWithId.clear();
}
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
visitor.startDocument(new LocatorEx() {
public ValidationEventLocator getLocation() {
return new ValidationEventLocatorImpl(this);
}
public int getColumnNumber() {
return getCurrentLocation().getColumnNumber();
}
public int getLineNumber() {
return getCurrentLocation().getLineNumber();
}
public String getPublicId() {
return getCurrentLocation().getPublicId();
}
public String getSystemId() {
return getCurrentLocation().getSystemId();
}
},nsc);
}
/**
* Called when a referenced object doesn't have an ID.
*/
public void errorMissingId(Object obj) throws SAXException {
reportError( new ValidationEventImpl(
ValidationEvent.ERROR,
Messages.MISSING_ID.format(obj),
new ValidationEventLocatorImpl(obj)) );
}
/**
* Called when a referenced object doesn't have an ID.
*/
public void errorMissingId(Object obj) throws SAXException {
reportError( new ValidationEventImpl(
ValidationEvent.ERROR,
Messages.MISSING_ID.format(obj),
new ValidationEventLocatorImpl(obj)) );
}
/**
* Called when a referenced object doesn't have an ID.
*/
public void errorMissingId(Object obj) throws SAXException {
reportError( new ValidationEventImpl(
ValidationEvent.ERROR,
Messages.MISSING_ID.format(obj),
new ValidationEventLocatorImpl(obj)) );
}
/**
* Called when a referenced object doesn't have an ID.
*/
public void errorMissingId(Object obj) throws SAXException {
reportError( new ValidationEventImpl(
ValidationEvent.ERROR,
Messages.MISSING_ID.format(obj),
new ValidationEventLocatorImpl(obj)) );
}
/**
* Called when a referenced object doesn't have an ID.
*/
public void errorMissingId(Object obj) throws SAXException {
reportError( new ValidationEventImpl(
ValidationEvent.ERROR,
Messages.MISSING_ID.format(obj),
new ValidationEventLocatorImpl(obj)) );
}
/**
* Called when a referenced object doesn't have an ID.
*/
public void errorMissingId(Object obj) throws SAXException {
reportError( new ValidationEventImpl(
ValidationEvent.ERROR,
Messages.MISSING_ID.format(obj),
new ValidationEventLocatorImpl(obj)) );
}