Class GrammarInfoImpl
- java.lang.Object
-
- com.sun.identity.wsfederation.jaxb.entityconfig.impl.runtime.GrammarInfoImpl
-
- All Implemented Interfaces:
GrammarInfo
public class GrammarInfoImpl extends Object implements GrammarInfo
Keeps the information about the grammar as a whole. This object is immutable and thread-safe.- Author:
- Kohsuke KAWAGUCHI
-
-
Constructor Summary
Constructors Constructor Description GrammarInfoImpl(Map _rootTagMap, Map _defaultImplementationMap, Class _objectFactoryClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidatableObjectcastToValidatableObject(Object o)XMLSerializablecastToXMLSerializable(Object o)UnmarshallingEventHandlercreateUnmarshaller(String namespaceUri, String localName, UnmarshallingContext context)Creates an unmarshaller that can unmarshal a given element.ClassgetDefaultImplementation(Class javaContentInterface)Gets the default implementation for the given public content interface.com.sun.msv.grammar.GrammargetGrammar()Gets the MSV AGM which can be used to validate XML during marshalling/unmarshalling.String[]getProbePoints()Return the probe points for this GrammarInfo, which are used to detect {namespaceURI,localName} collisions across the GrammarInfo's on the schemaPath.ClassgetRootElement(String namespaceUri, String localName)Creates an instance for the root element.booleanrecognize(String nsUri, String localName)Returns true if the invocation of the createUnmarshaller method will return a non-null value for the given name pair.
-
-
-
Method Detail
-
getRootElement
public final Class getRootElement(String namespaceUri, String localName)
Description copied from interface:GrammarInfoCreates an instance for the root element.- Specified by:
getRootElementin interfaceGrammarInfo- Returns:
- null if the given name pair is not recognized.
-
createUnmarshaller
public final UnmarshallingEventHandler createUnmarshaller(String namespaceUri, String localName, UnmarshallingContext context)
Description copied from interface:GrammarInfoCreates an unmarshaller that can unmarshal a given element.- Specified by:
createUnmarshallerin interfaceGrammarInfo- Parameters:
namespaceUri- The string needs to be interned by the caller for a performance reason.localName- The string needs to be interned by the caller for a performance reason.- Returns:
- null if the given name pair is not recognized.
-
getProbePoints
public final String[] getProbePoints()
Description copied from interface:GrammarInfoReturn 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.- Specified by:
getProbePointsin interfaceGrammarInfo
-
recognize
public final boolean recognize(String nsUri, String localName)
Description copied from interface:GrammarInfoReturns true if the invocation of the createUnmarshaller method will return a non-null value for the given name pair.- Specified by:
recognizein interfaceGrammarInfo- Parameters:
nsUri- The string needs to be interned by the caller for a performance reason.localName- The string needs to be interned by the caller for a performance reason.
-
getDefaultImplementation
public final Class getDefaultImplementation(Class javaContentInterface)
Description copied from interface:GrammarInfoGets the default implementation for the given public content interface.- Specified by:
getDefaultImplementationin interfaceGrammarInfo- Parameters:
javaContentInterface- the Class object of the public interface.- Returns:
- null If the interface is not found.
-
getGrammar
public final com.sun.msv.grammar.Grammar getGrammar() throws JAXBExceptionGets the MSV AGM which can be used to validate XML during marshalling/unmarshalling.- Specified by:
getGrammarin interfaceGrammarInfo- Throws:
JAXBException
-
castToXMLSerializable
public XMLSerializable castToXMLSerializable(Object o)
- Specified by:
castToXMLSerializablein interfaceGrammarInfo- See Also:
com.sun.tools.xjc.runtime.GrammarInfo#castToXMLSerializable(java.lang.Object)
-
castToValidatableObject
public ValidatableObject castToValidatableObject(Object o)
- Specified by:
castToValidatableObjectin interfaceGrammarInfo- See Also:
com.sun.tools.xjc.runtime.GrammarInfo#castToValidatableObject(java.lang.Object)
-
-