Util.java revision 5b64d5d44892834ba97f003080f3467299b7c5c5
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk// Any modifications to this file will be lost upon recompilation of the source schema.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk// Generated on: 2012.06.11 at 10:34:07 AM PDT
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkpackage com.sun.identity.saml2.jaxb.assertion.impl.runtime;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.xml.bind.serializer.AbortSerializationException;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport com.sun.xml.bind.util.ValidationEventLocatorExImpl;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport javax.xml.bind.helpers.PrintConversionEventImpl;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport javax.xml.bind.helpers.ValidationEventImpl;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport javax.xml.bind.helpers.ValidationEventLocatorImpl;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkpublic class Util {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Reports a print conversion error while marshalling.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk public static void handlePrintConversionException(
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk Object caller, Exception e, XMLSerializer serializer ) throws SAXException {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if( e instanceof SAXException )
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk // assume this exception is not from application.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk // (e.g., when a marshaller aborts the processing, this exception
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk // will be thrown)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ValidationEvent ve = new PrintConversionEventImpl(
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Reports that the type of an object in a property is unexpected.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk public static void handleTypeMismatchError( XMLSerializer serializer,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk Object parentObject, String fieldName, Object childObject ) throws AbortSerializationException {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ValidationEvent.ERROR, // maybe it should be a fatal error.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk new ValidationEventLocatorExImpl(parentObject,fieldName) );
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private static String getUserFriendlyTypeName( Object o ) {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk if( o instanceof ValidatableObject)