org.tagnetic.core.jaxb.tagneticconfig.impl.runtime
Class GrammarInfoImpl

java.lang.Object
  extended byorg.tagnetic.core.jaxb.tagneticconfig.impl.runtime.GrammarInfoImpl
All Implemented Interfaces:
GrammarInfo

public class GrammarInfoImpl
extends java.lang.Object
implements GrammarInfo

Keeps the information about the grammar as a whole. This object is immutable and thread-safe.

Author:
Kohsuke KAWAGUCHI

Constructor Summary
GrammarInfoImpl(java.util.Map _rootTagMap, java.util.Map _defaultImplementationMap, java.lang.Class _objectFactoryClass)
           
 
Method Summary
 ValidatableObject castToValidatableObject(java.lang.Object o)
           
 XMLSerializable castToXMLSerializable(java.lang.Object o)
           
 UnmarshallingEventHandler createUnmarshaller(java.lang.String namespaceUri, java.lang.String localName, UnmarshallingContext context)
          Creates an unmarshaller that can unmarshal a given element.
 java.lang.Class getDefaultImplementation(java.lang.Class javaContentInterface)
          Gets the default implementation for the given public content interface.
 com.sun.msv.grammar.Grammar getGrammar()
          Gets the MSV AGM which can be used to validate XML during marshalling/unmarshalling.
 java.lang.String[] getProbePoints()
          Return the probe points for this GrammarInfo, which are used to detect {namespaceURI,localName} collisions across the GrammarInfo's on the schemaPath.
 java.lang.Class getRootElement(java.lang.String namespaceUri, java.lang.String localName)
          Creates an instance for the root element.
 boolean recognize(java.lang.String nsUri, java.lang.String localName)
          Returns true if the invocation of the createUnmarshaller method will return a non-null value for the given name pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrammarInfoImpl

public GrammarInfoImpl(java.util.Map _rootTagMap,
                       java.util.Map _defaultImplementationMap,
                       java.lang.Class _objectFactoryClass)
Method Detail

getRootElement

public final java.lang.Class getRootElement(java.lang.String namespaceUri,
                                            java.lang.String localName)
Description copied from interface: GrammarInfo
Creates an instance for the root element.

Specified by:
getRootElement in interface GrammarInfo
Returns:
null if the given name pair is not recognized.

createUnmarshaller

public final UnmarshallingEventHandler createUnmarshaller(java.lang.String namespaceUri,
                                                          java.lang.String localName,
                                                          UnmarshallingContext context)
Description copied from interface: GrammarInfo
Creates an unmarshaller that can unmarshal a given element.

Specified by:
createUnmarshaller in interface GrammarInfo
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 java.lang.String[] getProbePoints()
Description copied from interface: GrammarInfo
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.

Specified by:
getProbePoints in interface GrammarInfo

recognize

public final boolean recognize(java.lang.String nsUri,
                               java.lang.String localName)
Description copied from interface: GrammarInfo
Returns true if the invocation of the createUnmarshaller method will return a non-null value for the given name pair.

Specified by:
recognize in interface GrammarInfo
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 java.lang.Class getDefaultImplementation(java.lang.Class javaContentInterface)
Description copied from interface: GrammarInfo
Gets the default implementation for the given public content interface.

Specified by:
getDefaultImplementation in interface GrammarInfo
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 JAXBException
Gets the MSV AGM which can be used to validate XML during marshalling/unmarshalling.

Specified by:
getGrammar in interface GrammarInfo
Throws:
JAXBException

castToXMLSerializable

public XMLSerializable castToXMLSerializable(java.lang.Object o)
Specified by:
castToXMLSerializable in interface GrammarInfo
See Also:
com.sun.tools.xjc.runtime.GrammarInfo#castToXMLSerializable(java.lang.Object)

castToValidatableObject

public ValidatableObject castToValidatableObject(java.lang.Object o)
Specified by:
castToValidatableObject in interface GrammarInfo
See Also:
com.sun.tools.xjc.runtime.GrammarInfo#castToValidatableObject(java.lang.Object)


Copyright © 2005 tagnetic.org. All Rights Reserved.