com.sun.xml.ws.db.glassfish
Class JAXBRIContextWrapper

java.lang.Object
  extended by com.sun.xml.ws.db.glassfish.JAXBRIContextWrapper
All Implemented Interfaces:
BindingContext

 class JAXBRIContextWrapper
extends Object
implements BindingContext


Field Summary
 
Fields inherited from interface com.sun.xml.ws.spi.db.BindingContext
CANONICALIZATION_SUPPORT, DEFAULT_NAMESPACE_REMAP, ENABLE_XOP, RETAIN_REFERENCE_TO_INFO, SUBCLASS_REPLACEMENTS, TREAT_EVERYTHING_NILLABLE, TYPE_REFERENCES, XMLACCESSORFACTORY_SUPPORT
 
Constructor Summary
JAXBRIContextWrapper(com.sun.xml.bind.api.JAXBRIContext cxt, Map<TypeInfo,com.sun.xml.bind.api.TypeReference> refs)
           
 
Method Summary
 XMLBridge createBridge(TypeInfo ti)
          Creates a mini-marshaller/unmarshaller that can process a TypeInfo.
 XMLBridge createFragmentBridge()
           
 Marshaller createMarshaller()
           
 Unmarshaller createUnmarshaller()
           
 void generateSchema(SchemaOutputResolver outputResolver)
          Generates the schema documents from the model.
 String getBuildId()
          Gets the build information of the JAXB runtime.
 QName getElementName(Class o)
          Allows to retrieve the element name based on Class.
 QName getElementName(Object o)
          If the given object is bound to an element in XML by JAXB, returns the element name.
<B,V> PropertyAccessor<B,V>
getElementPropertyAccessor(Class<B> wrapperBean, String nsUri, String localName)
          Gets a PropertyAccessor for the specified element property of the specified wrapper bean class.
 JAXBContext getJAXBContext()
           
 List<String> getKnownNamespaceURIs()
          Gets the namespace URIs statically known to this JAXBContext.
 com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfoSet getRuntimeTypeInfoSet()
           
 QName getTypeName(TypeInfo ti)
          Returns the name of the XML Type bound to the specified Java type.
 QName getTypeName(com.sun.xml.bind.api.TypeReference tr)
           
 int hashCode()
           
 boolean hasSwaRef()
          Returns true if this context includes a class that has XmlAttachmentRef.
 Object newWrapperInstace(Class<?> wrapperType)
           
 String toString()
           
(package private)  TypeInfo typeInfo(com.sun.xml.bind.api.TypeReference tr)
           
(package private)  com.sun.xml.bind.api.TypeReference typeReference(TypeInfo ti)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JAXBRIContextWrapper

JAXBRIContextWrapper(com.sun.xml.bind.api.JAXBRIContext cxt,
                     Map<TypeInfo,com.sun.xml.bind.api.TypeReference> refs)
Method Detail

typeReference

com.sun.xml.bind.api.TypeReference typeReference(TypeInfo ti)

typeInfo

TypeInfo typeInfo(com.sun.xml.bind.api.TypeReference tr)

createMarshaller

public Marshaller createMarshaller()
                            throws JAXBException
Specified by:
createMarshaller in interface BindingContext
Throws:
JAXBException

createUnmarshaller

public Unmarshaller createUnmarshaller()
                                throws JAXBException
Specified by:
createUnmarshaller in interface BindingContext
Throws:
JAXBException

generateSchema

public void generateSchema(SchemaOutputResolver outputResolver)
                    throws IOException
Description copied from interface: BindingContext
Generates the schema documents from the model.

The caller can use the additionalElementDecls parameter to add element declarations to the generate schema. For example, if the JAX-RPC passes in the following entry: {foo}bar -> DeclaredType for java.lang.String then JAXB generates the following element declaration (in the schema document for the namespace "foo")" <xs:element name="bar" type="xs:string" /> This can be used for generating schema components necessary for WSDL.

Specified by:
generateSchema in interface BindingContext
Parameters:
outputResolver - this object controls the output to which schemas will be sent.
Throws:
IOException - if SchemaOutputResolver throws an IOException.

getBuildId

public String getBuildId()
Description copied from interface: BindingContext
Gets the build information of the JAXB runtime.

Specified by:
getBuildId in interface BindingContext
Returns:
may be null, if the runtime is loaded by a class loader that doesn't support the access to the manifest informatino.

getElementName

public QName getElementName(Class o)
                     throws JAXBException
Description copied from interface: BindingContext
Allows to retrieve the element name based on Class.

Specified by:
getElementName in interface BindingContext
Returns:
Throws:
JAXBException

getElementName

public QName getElementName(Object o)
                     throws JAXBException
Description copied from interface: BindingContext
If the given object is bound to an element in XML by JAXB, returns the element name.

Specified by:
getElementName in interface BindingContext
Returns:
null if the object is not bound to an element.
Throws:
JAXBException - if the object is not known to this context.

getElementPropertyAccessor

public <B,V> PropertyAccessor<B,V> getElementPropertyAccessor(Class<B> wrapperBean,
                                                              String nsUri,
                                                              String localName)
                                                 throws JAXBException
Description copied from interface: BindingContext
Gets a PropertyAccessor for the specified element property of the specified wrapper bean class.

This method is designed to assist the JAX-RPC RI fill in a wrapper bean (in the doc/lit/wrap mode.) In the said mode, a wrapper bean is supposed to only have properties that match elements, and for each element that appear in the content model there's one property.

Therefore, this method takes a wrapper bean and a tag name that identifies a property on the given wrapper bean, then returns a PropertyAccessor that allows the caller to set/get a value from the property of the bean.

This method is not designed for a performance. The caller is expected to cache the result.

Specified by:
getElementPropertyAccessor in interface BindingContext
Type Parameters:
B - type of the wrapper bean
V - type of the property of the bean
Returns:
always return non-null valid accessor object.
Throws:
JAXBException - if the specified wrapper bean is not bound by JAXB, or if it doesn't have an element property of the given name.

getKnownNamespaceURIs

public List<String> getKnownNamespaceURIs()
Description copied from interface: BindingContext
Gets the namespace URIs statically known to this JAXBContext.

When JAXB is used to marshal into sub-trees, it declares these namespace URIs at each top-level element that it marshals. To avoid repeated namespace declarations at sub-elements, the application may declare those namespaces at a higher level.

Specified by:
getKnownNamespaceURIs in interface BindingContext
Returns:
always non-null.

getRuntimeTypeInfoSet

public com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfoSet getRuntimeTypeInfoSet()

getTypeName

public QName getTypeName(com.sun.xml.bind.api.TypeReference tr)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

hasSwaRef

public boolean hasSwaRef()
Description copied from interface: BindingContext
Returns true if this context includes a class that has XmlAttachmentRef.

Specified by:
hasSwaRef in interface BindingContext

toString

public String toString()
Overrides:
toString in class Object

createBridge

public XMLBridge createBridge(TypeInfo ti)
Description copied from interface: BindingContext
Creates a mini-marshaller/unmarshaller that can process a TypeInfo.

Specified by:
createBridge in interface BindingContext
Returns:
null if the specified reference is not given to BindingContext#newInstance.

getJAXBContext

public JAXBContext getJAXBContext()
Specified by:
getJAXBContext in interface BindingContext

getTypeName

public QName getTypeName(TypeInfo ti)
Description copied from interface: BindingContext
Returns the name of the XML Type bound to the specified Java type.

Specified by:
getTypeName in interface BindingContext
Parameters:
ti - must not be null. This must be one of the TypeInfos specified in the BindingContext#newInstance method.
Returns:
null if the referenced type is an anonymous and therefore doesn't have a name.

createFragmentBridge

public XMLBridge createFragmentBridge()
Specified by:
createFragmentBridge in interface BindingContext

newWrapperInstace

public Object newWrapperInstace(Class<?> wrapperType)
                         throws InstantiationException,
                                IllegalAccessException
Specified by:
newWrapperInstace in interface BindingContext
Throws:
InstantiationException
IllegalAccessException


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.