//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.06.11 at 10:33:54 AM PDT
//
/**
* Default Unmarshall implementation.
*
* <p>
* This class can be extended by the generated code to provide
* type-safe unmarshall methods.
*
* @author
* <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
*/
{
/** parent JAXBContext object that created this unmarshaller */
this.grammarInfo = gi;
// initialize datatype converter with ours
}
super.setValidating(validating);
if(validating==true)
// make sure that we can actually load the grammar.
// this could be a lengthy operation if your schema is big.
}
// use InterningUnmarshallerHandler since we don't know
// if the caller will intern Strings before firing SAX events.
// we don't know the Locator to be used,
// but SAXLocator would always be a good default,
// as the source of SAX2 events can always set org.xml.sax.Locator.
return new InterningUnmarshallerHandler(
createUnmarshallerHandler(new SAXLocator()));
}
/**
* Creates and configures a new unmarshalling pipe line.
* Depending on the setting, we put a validator as a filter.
*
* @return
* A component that implements both UnmarshallerHandler
* and ValidationEventHandler. All the parsing errors
* should be reported to this error handler for the unmarshalling
* process to work correctly.
*
* @param locator
* The object that is responsible to obtain the source
* location information for {@link ValidationEvent}s.
*/
new SAXUnmarshallerHandlerImpl( this, grammarInfo );
try {
// use the simple check to determine if validation is on
if( isValidating() ) {
// if the validation is turned on, insert another
// component into the event pipe line.
}
} catch( JAXBException e ) {
// impossible since we've already made sure that a grammar is accessible.
e.printStackTrace();
}
return unmarshaller;
}
// saxErrorHandler will be set by the createUnmarshallerHandler method.
// configure XMLReader so that the error will be sent to it.
// This is essential for the UnmarshallerHandler to be able to abort
// unmarshalling when an error is found.
//
// Note that when this XMLReader is provided by the client code,
// it might be already configured to call a client error handler.
// This will clobber such handler, if any.
//
// Ryan noted that we might want to report errors to such a client
// error handler as well.
try {
} catch( IOException e ) {
throw new JAXBException(e);
} catch( SAXException e ) {
throw createUnmarshalException(e);
}
// avoid keeping unnecessary references too long to let the GC
// reclaim more memory.
// setting null upsets some parsers, so use a dummy instance instead.
return result;
}
try {
else
else
// no other type of input is supported
throw new IllegalArgumentException();
} catch( SAXException e ) {
throw createUnmarshalException(e);
}
}
// just to make the the test harness happy by making this method accessible
}
}