//
// 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:34:16 AM PDT
//
/**
* This class is a facade to a collection of GrammarInfo objects. It
* dispatches rootElement requests to the underlying GrammarInfo objects.
*
* @version $Revision: 1.2 $
*/
}
/*
* Gets a generated implementation class for the specified root element.
* This method is used to determine the first object to be unmarshalled.
*/
public UnmarshallingEventHandler createUnmarshaller(String namespaceUri, String localName, UnmarshallingContext context) {
// find the root element among the GrammarInfos
UnmarshallingEventHandler ueh = grammarInfos[i].createUnmarshaller( namespaceUri, localName, context );
return ueh;
}
}
// the element was not located in any of the grammar infos...
return null;
}
// find the root element among the GrammarInfos
if( c != null ) {
return c;
}
}
// the element was not located in any of the grammar infos...
return null;
}
return true;
return false;
}
/*
* Return the probe points for this GrammarInfo, which are used to detect
* {namespaceURI,localName} collisions across the GrammarInfo's on the
* schemaPath. This is a slightly more complex implementation than a simple
* hashmap, but it is more flexible in supporting additional schema langs.
*/
}
}
// once per JAXBContext creation, so it may not be worth it.
}
/**
* Iterate through the probe points looking for root element collisions.
* If a duplicate is detected, then multiple root element componenets
* exist with the same uri:localname
*/
throws JAXBException {
// the array of probe points contain uri:localname pairs
// iterate over GrammarInfos - if more than one GI returns
// a class from getRootElement, then there is a collision
boolean elementFound = false;
if( elementFound == false ) {
elementFound = true;
} else {
throw new JAXBException(
}
}
}
}
}
/*
* This static method is used to setup the GrammarInfoFacade. It
* is invoked by the DefaultJAXBContextImpl constructor
*/
throws JAXBException {
// array of GrammarInfo objs
// instantiate all of the specified JAXBContextImpls
while( st.hasMoreTokens() ) {
try {
// check version
else
getVersion(c) } ) );
// use reflection to get GrammarInfo
// wrap the grammarInfo into a proxy if necessary
grammarInfo, GrammarInfo.class,
new Class[]{
GrammarInfo.class,
UnmarshallingContext.class,
UnmarshallingEventHandler.class,
XMLSerializer.class,
XMLSerializable.class,
NamespaceContext2.class,
ValidatableObject.class
} );
} catch( ClassNotFoundException e ) {
throw new NoClassDefFoundError(e.getMessage());
} catch( Exception e ) {
throw new JAXBException(e);
}
}
// if there's only one path, no need to use a facade.
return new GrammarInfoFacade(
}
/**
* Obtains a version number of the JAXB RI that has generated
* the specified context, or null if it fails (for example
* because it's not generated by JAXB RI.)
*
* @param c
* an instance of a generated ObjectFactory class.
* This will return the version number written into
* the corresponding JAXBVersion class.
*/
try {
} catch( Throwable t ) {
return null;
}
}
if(c!=null) return c;
}
return null;
}
// load al the grammars individually
// connect them to each other
if( grammars[i] instanceof GrammarImpl )
// take union of them
}
}
return bgm;
}
/**
* Computes the union of two grammars.
*/
private com.sun.msv.grammar.Grammar union( com.sun.msv.grammar.Grammar g1, com.sun.msv.grammar.Grammar g2 ) {
// either g1.getPool() or g2.getPool() is OK.
// this is just a metter of performance problem.
return pool;
}
return top;
}
};
}
/**
* @see com.sun.tools.xjc.runtime.GrammarInfo#castToXMLSerializable(java.lang.Object)
*/
return result;
}
}
return null;
}
/**
* @see com.sun.tools.xjc.runtime.GrammarInfo#castToValidatableObject(java.lang.Object)
*/
return result;
}
}
return null;
}
}