use of javax.xml.bind.helpers.ValidationEventLocatorImpl in project OpenAM by OpenRock.
the class ValidationContext method reconcileIDs.
/** Tests if all IDREFs have corresponding IDs. */
protected void reconcileIDs() throws SAXException {
if (!validateID)
return;
for (Iterator itr = IDREFs.entrySet().iterator(); itr.hasNext(); ) {
Map.Entry e = (Map.Entry) itr.next();
if (IDs.contains(e.getKey()))
// OK.
continue;
// ID was not found.
ValidatableObject source = (ValidatableObject) e.getValue();
reportEvent(source, new NotIdentifiableEventImpl(ValidationEvent.ERROR, Messages.format(Messages.ID_NOT_FOUND, e.getKey()), new ValidationEventLocatorImpl(source)));
}
IDREFs.clear();
}
use of javax.xml.bind.helpers.ValidationEventLocatorImpl in project OpenAM by OpenRock.
the class AbstractUnmarshallingEventHandlerImpl method handleParseConversionException.
/**
* This method is called by the generated derived class
* when a datatype parse method throws an exception.
*/
protected void handleParseConversionException(Exception e) throws SAXException {
if (e instanceof RuntimeException)
// don't catch the runtime exception. just let it go.
throw (RuntimeException) e;
// wrap it into a ParseConversionEvent and report it
ParseConversionEvent pce = new ParseConversionEventImpl(ValidationEvent.ERROR, e.getMessage(), new ValidationEventLocatorImpl(context.getLocator()), e);
context.handleEvent(pce, true);
}
use of javax.xml.bind.helpers.ValidationEventLocatorImpl in project OpenAM by OpenRock.
the class Util method handlePrintConversionException.
/**
* Reports a print conversion error while marshalling.
*/
public static void handlePrintConversionException(Object caller, Exception e, XMLSerializer serializer) throws SAXException {
if (e instanceof SAXException)
// will be thrown)
throw (SAXException) e;
String message = e.getMessage();
if (message == null) {
message = e.toString();
}
ValidationEvent ve = new PrintConversionEventImpl(ValidationEvent.ERROR, message, new ValidationEventLocatorImpl(caller), e);
serializer.reportError(ve);
}
use of javax.xml.bind.helpers.ValidationEventLocatorImpl in project OpenAM by OpenRock.
the class ValidationContext method reconcileIDs.
/** Tests if all IDREFs have corresponding IDs. */
protected void reconcileIDs() throws SAXException {
if (!validateID)
return;
for (Iterator itr = IDREFs.entrySet().iterator(); itr.hasNext(); ) {
Map.Entry e = (Map.Entry) itr.next();
if (IDs.contains(e.getKey()))
// OK.
continue;
// ID was not found.
ValidatableObject source = (ValidatableObject) e.getValue();
reportEvent(source, new NotIdentifiableEventImpl(ValidationEvent.ERROR, Messages.format(Messages.ID_NOT_FOUND, e.getKey()), new ValidationEventLocatorImpl(source)));
}
IDREFs.clear();
}
use of javax.xml.bind.helpers.ValidationEventLocatorImpl in project OpenAM by OpenRock.
the class SAXMarshaller method onIDREF.
public String onIDREF(IdentifiableObject obj) throws SAXException {
idReferencedObjects.add(obj);
String id = obj.____jaxb____getId();
if (id == null) {
reportError(new NotIdentifiableEventImpl(ValidationEvent.ERROR, Messages.format(Messages.ERR_NOT_IDENTIFIABLE), new ValidationEventLocatorImpl(obj)));
}
return id;
}
Aggregations