|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.bind.v2.runtime.JaxBeanInfo<BeanT>
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl<BeanT>
public final class ClassBeanInfoImpl<BeanT>
JaxBeanInfo implementation for j2s bean.
| Field Summary | |
|---|---|
Property<BeanT>[] |
properties
Properties of this bean class but not its ancestor classes. |
ClassBeanInfoImpl<? super BeanT> |
superClazz
ClassBeanInfoImpl that represents the super class of JaxBeanInfo.jaxbType. |
| Fields inherited from class com.sun.xml.bind.v2.runtime.JaxBeanInfo |
|---|
jaxbType |
| Method Summary | |
|---|---|
BeanT |
createInstance(UnmarshallingContext context)
Creates a new instance of the bean. |
java.lang.String |
getElementLocalName(BeanT bean)
Returns the local name portion of the element name, if the bean that this class represents is mapped from/to an XML element. |
java.lang.String |
getElementNamespaceURI(BeanT bean)
Returns the namespace URI portion of the element name, if the bean that this class represents is mapped from/to an XML element. |
java.lang.String |
getId(BeanT bean,
XMLSerializer target)
Gets the ID value of the given bean, if it has an ID value. |
Loader |
getLoader(JAXBContextImpl context,
boolean typeSubstitutionCapable)
Gets the Loader that will unmarshall the given object. |
Transducer<BeanT> |
getTransducer()
If the bean's representation in XML is just a text, this method return a Transducer that lets you convert
values between the text and the bean. |
boolean |
reset(BeanT bean,
UnmarshallingContext context)
Resets the object to the initial state, as if the object is created fresh. |
void |
serializeAttributes(BeanT bean,
XMLSerializer target)
Serializes attributes into the specified target. |
void |
serializeBody(BeanT bean,
XMLSerializer target)
Serializes child elements and texts into the specified target. |
void |
serializeRoot(BeanT bean,
XMLSerializer target)
Serializes the bean as the root element. |
void |
serializeURIs(BeanT bean,
XMLSerializer target)
Declares all the namespace URIs this object is using at its top-level scope into the specified target. |
void |
wrapUp()
Called at the end of the JAXBContext initialization phase
to clean up any unnecessary references. |
| Methods inherited from class com.sun.xml.bind.v2.runtime.JaxBeanInfo |
|---|
getLifecycleMethods, getTypeName, getTypeNames, hasAfterMarshalMethod, hasAfterUnmarshalMethod, hasBeforeMarshalMethod, hasBeforeUnmarshalMethod, hasElementOnlyContentModel, invokeAfterUnmarshalMethod, invokeBeforeUnmarshalMethod, isElement, isImmutable, isNilIncluded, lookForLifecycleMethods |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.xml.bind.v2.runtime.AttributeAccessor |
|---|
isNilIncluded |
| Field Detail |
|---|
public final Property<BeanT>[] properties
public final ClassBeanInfoImpl<? super BeanT> superClazz
ClassBeanInfoImpl that represents the super class of JaxBeanInfo.jaxbType.
| Method Detail |
|---|
public void wrapUp()
JaxBeanInfoJAXBContext initialization phase
to clean up any unnecessary references.
wrapUp in class JaxBeanInfo<BeanT>public java.lang.String getElementNamespaceURI(BeanT bean)
JaxBeanInfo
getElementNamespaceURI in class JaxBeanInfo<BeanT>public java.lang.String getElementLocalName(BeanT bean)
JaxBeanInfo
getElementLocalName in class JaxBeanInfo<BeanT>
public BeanT createInstance(UnmarshallingContext context)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.InstantiationException,
org.xml.sax.SAXException
JaxBeanInfo
This operation is only supported when JaxBeanInfo.isImmutable() is false.
createInstance in class JaxBeanInfo<BeanT>context - Sometimes the created bean remembers the corresponding source location,
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
org.xml.sax.SAXException
public boolean reset(BeanT bean,
UnmarshallingContext context)
throws org.xml.sax.SAXException
JaxBeanInfoThis is used to reuse an existing object for unmarshalling.
reset in class JaxBeanInfo<BeanT>context - used for reporting any errors.
If the object is resettable but failed by an error, it should be reported to the context, then return false. If the object is not resettable to begin with, do not report an error.
org.xml.sax.SAXException - as a result of reporting an error, the context may throw a SAXException.
public java.lang.String getId(BeanT bean,
XMLSerializer target)
throws org.xml.sax.SAXException
JaxBeanInfo
getId in class JaxBeanInfo<BeanT>org.xml.sax.SAXException
public void serializeRoot(BeanT bean,
XMLSerializer target)
throws org.xml.sax.SAXException,
java.io.IOException,
javax.xml.stream.XMLStreamException
JaxBeanInfoIn the java-to-schema binding, an object might marshal in two different ways depending on whether it is used as the root of the graph or not. In the former case, an object could marshal as an element, whereas in the latter case, it marshals as a type.
This method is used to marshal the root of the object graph to allow this semantics to be implemented.
It is doubtful to me if it's a good idea for an object to marshal in two ways depending on the context.
For schema-to-java, this is equivalent to JaxBeanInfo.serializeBody(Object, XMLSerializer).
serializeRoot in class JaxBeanInfo<BeanT>org.xml.sax.SAXException
java.io.IOException
javax.xml.stream.XMLStreamException
public void serializeBody(BeanT bean,
XMLSerializer target)
throws org.xml.sax.SAXException,
java.io.IOException,
javax.xml.stream.XMLStreamException
JaxBeanInfo
serializeBody in class JaxBeanInfo<BeanT>org.xml.sax.SAXException
java.io.IOException
javax.xml.stream.XMLStreamException
public void serializeAttributes(BeanT bean,
XMLSerializer target)
throws org.xml.sax.SAXException,
java.io.IOException,
javax.xml.stream.XMLStreamException
JaxBeanInfo
serializeAttributes in class JaxBeanInfo<BeanT>org.xml.sax.SAXException
java.io.IOException
javax.xml.stream.XMLStreamException
public void serializeURIs(BeanT bean,
XMLSerializer target)
throws org.xml.sax.SAXException
JaxBeanInfo
serializeURIs in class JaxBeanInfo<BeanT>org.xml.sax.SAXException
public Loader getLoader(JAXBContextImpl context,
boolean typeSubstitutionCapable)
JaxBeanInfoLoader that will unmarshall the given object.
getLoader in class JaxBeanInfo<BeanT>context - The JAXBContextImpl object that governs this object.
This object is taken as a parameter so that JaxBeanInfo doesn't have
to store them on its own.
When this method is invoked from within the unmarshaller, tihs parameter can be
null (because the loader is constructed already.)typeSubstitutionCapable - If true, the returned Loader is capable of recognizing @xsi:type (if necessary)
and unmarshals a subtype. This allowes an optimization where this bean info
is guaranteed not to have a type substitution.
If false, the returned Loader doesn't look for @xsi:type.
public Transducer<BeanT> getTransducer()
JaxBeanInfoTransducer that lets you convert
values between the text and the bean.
getTransducer in class JaxBeanInfo<BeanT>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||