Java Doc for JaxBeanInfo.java in  » 6.0-JDK-Modules-com.sun » xml » com » sun » xml » internal » bind » v2 » runtime » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules com.sun » xml » com.sun.xml.internal.bind.v2.runtime 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo

All known Subclasses:   com.sun.xml.internal.bind.v2.runtime.ValueListBeanInfoImpl,  com.sun.xml.internal.bind.v2.runtime.ArrayBeanInfoImpl,
JaxBeanInfo
abstract public class JaxBeanInfo (Code)
Encapsulates various JAXB operations on objects bound by JAXB. Immutable and thread-safe.

Each JAXB-bound class has a corresponding JaxBeanInfo object, which performs all the JAXB related operations on behalf of the JAXB-bound object.

Given a class, the corresponding JaxBeanInfo can be located via JAXBContextImpl.getBeanInfo(Classboolean) .

Typically, JaxBeanInfo implementations should be generated by XJC/JXC. Those impl classes will register themselves to their master ObjectFactory class.

The type parameter BeanT is the Java class of the bean that this represents.
author:
   Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)



Field Summary
protected  shortflag
     Various boolean flags combined into one field to improve memory footprint.
final public  Class<BeanT>jaxbType
     Gets the JAXB bound class type that this JaxBeanInfo handles.

Constructor Summary
protected  JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, QName[] typeNames, boolean isElement, boolean isImmutable, boolean hasLifecycleEvents)
     For JaxBeanInfo that has multiple type names.
protected  JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, QName typeName, boolean isElement, boolean isImmutable, boolean hasLifecycleEvents)
     For JaxBeanInfo that has one type name.
protected  JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, boolean isElement, boolean isImmutable, boolean hasLifecycleEvents)
     For JaxBeanInfo that has no type names.

Method Summary
abstract public  BeanTcreateInstance(UnmarshallingContext context)
     Creates a new instance of the bean.
abstract public  StringgetElementLocalName(BeanT o)
     Returns the local name portion of the element name, if the bean that this class represents is mapped from/to an XML element.
abstract public  StringgetElementNamespaceURI(BeanT o)
     Returns the namespace URI portion of the element name, if the bean that this class represents is mapped from/to an XML element.
abstract public  StringgetId(BeanT o, XMLSerializer target)
     Gets the ID value of the given bean, if it has an ID value.
final public  LifecycleMethodsgetLifecycleMethods()
     Return the LifecycleMethods cache for this ClassBeanInfo's corresponding jaxbType if it exists, else return null.
abstract public  LoadergetLoader(JAXBContextImpl context, boolean typeSubstitutionCapable)
     Gets the Loader that will unmarshall the given object.
Parameters:
  context - The JAXBContextImpl object that governs this object.This object is taken as a parameter so that JaxBeanInfo doesn't haveto store them on its own.When this method is invoked from within the unmarshaller, tihs parameter can benull (because the loader is constructed already.)
Parameters:
  typeSubstitutionCapable - If true, the returned Loader is capable of recognizing @xsi:type (if necessary)and unmarshals a subtype.
abstract public  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.
public  QNamegetTypeName(BeanT instance)
     Returns the XML type name to be used to marshal the specified instance.
public  Collection<QName>getTypeNames()
     Returns XML Schema type names if the bean is mapped from a complex/simple type of XML Schema.

This is an ugly necessity to correctly handle the type substitution semantics of XML Schema.

A single Java class maybe mapped to more than one XML types.

final public  booleanhasAfterMarshalMethod()
     True if JaxBeanInfo.jaxbType has the lifecycle method.
final public  booleanhasAfterUnmarshalMethod()
     True if JaxBeanInfo.jaxbType has the lifecycle method.
final public  booleanhasBeforeMarshalMethod()
     True if JaxBeanInfo.jaxbType has the lifecycle method.
final public  booleanhasBeforeUnmarshalMethod()
     True if JaxBeanInfo.jaxbType has the lifecycle method.
final public  booleanhasElementOnlyContentModel()
     True if this bean has an element-only content model.
final protected  voidhasElementOnlyContentModel(boolean value)
     True if this bean has an element-only content model.
final public  voidinvokeAfterUnmarshalMethod(UnmarshallerImpl unm, Object child, Object parent)
     Invokes the afterUnmarshal method if applicable.
final public  voidinvokeBeforeUnmarshalMethod(UnmarshallerImpl unm, Object child, Object parent)
     Invokes the beforeUnmarshal method if applicable.
final public  booleanisElement()
     Returns true if the bean is mapped to/from an XML element.
final public  booleanisImmutable()
     Returns true if the bean is immutable.
protected  voidlink(JAXBContextImpl grammar)
     Called after all the JaxBeanInfo s are created.
public  booleanlookForLifecycleMethods()
     This method is used to determine which of the sub-classes should be interrogated for the existence of lifecycle methods.
abstract public  booleanreset(BeanT o, UnmarshallingContext context)
     Resets the object to the initial state, as if the object is created fresh.

This is used to reuse an existing object for unmarshalling.
Parameters:
  context - used for reporting any errors.true if the object was successfuly resetted.False if the object is not resettable, in which case the object will bediscarded and new one will be created.

If the object is resettable but failed by an error, it should be reported to the context,then return false.

abstract public  voidserializeAttributes(BeanT o, XMLSerializer target)
     Serializes attributes into the specified target.
abstract public  voidserializeBody(BeanT o, XMLSerializer target)
     Serializes child elements and texts into the specified target.
abstract public  voidserializeRoot(BeanT o, XMLSerializer target)
     Serializes the bean as the root element.
abstract public  voidserializeURIs(BeanT o, XMLSerializer target)
     Declares all the namespace URIs this object is using at its top-level scope into the specified target.
final protected  voidsetLifecycleFlags()
     use reflection to determine which of the 4 object lifecycle methods exist on the JAXB bound type.
public  voidwrapUp()
     Called at the end of the JAXBContext initialization phase to clean up any unnecessary references.

Field Detail
flag
protected short flag(Code)
Various boolean flags combined into one field to improve memory footprint.



jaxbType
final public Class<BeanT> jaxbType(Code)
Gets the JAXB bound class type that this JaxBeanInfo handles.

IOW, when a bean info object is requested for T, sometimes the bean info for one of its base classes might be returned.





Constructor Detail
JaxBeanInfo
protected JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, QName[] typeNames, boolean isElement, boolean isImmutable, boolean hasLifecycleEvents)(Code)
For JaxBeanInfo that has multiple type names.



JaxBeanInfo
protected JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, QName typeName, boolean isElement, boolean isImmutable, boolean hasLifecycleEvents)(Code)
For JaxBeanInfo that has one type name.



JaxBeanInfo
protected JaxBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo rti, Class<BeanT> jaxbType, boolean isElement, boolean isImmutable, boolean hasLifecycleEvents)(Code)
For JaxBeanInfo that has no type names.




Method Detail
createInstance
abstract public BeanT createInstance(UnmarshallingContext context) throws IllegalAccessException, InvocationTargetException, InstantiationException, SAXException(Code)
Creates a new instance of the bean.

This operation is only supported when JaxBeanInfo.isImmutable is false.
Parameters:
  context - Sometimes the created bean remembers the corresponding source location,




getElementLocalName
abstract public String getElementLocalName(BeanT o)(Code)
Returns the local name portion of the element name, if the bean that this class represents is mapped from/to an XML element.
throws:
  UnsupportedOperationException - if JaxBeanInfo.isElement is false.



getElementNamespaceURI
abstract public String getElementNamespaceURI(BeanT o)(Code)
Returns the namespace URI portion of the element name, if the bean that this class represents is mapped from/to an XML element.
throws:
  UnsupportedOperationException - if JaxBeanInfo.isElement is false.



getId
abstract public String getId(BeanT o, XMLSerializer target) throws SAXException(Code)
Gets the ID value of the given bean, if it has an ID value. Otherwise return null.



getLifecycleMethods
final public LifecycleMethods getLifecycleMethods()(Code)
Return the LifecycleMethods cache for this ClassBeanInfo's corresponding jaxbType if it exists, else return null.



getLoader
abstract public Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable)(Code)
Gets the Loader that will unmarshall the given object.
Parameters:
  context - The JAXBContextImpl object that governs this object.This object is taken as a parameter so that JaxBeanInfo doesn't haveto store them on its own.When this method is invoked from within the unmarshaller, tihs parameter can benull (because the loader is constructed already.)
Parameters:
  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 infois guaranteed not to have a type substitution.If false, the returned Loader doesn't look for @xsi:type.must return non-null valid object



getTransducer
abstract public Transducer<BeanT> getTransducer()(Code)
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.



getTypeName
public QName getTypeName(BeanT instance)(Code)
Returns the XML type name to be used to marshal the specified instance.

Most of the times the type can be determined regardless of the actual instance, but there's a few exceptions (most notably XMLGregorianCalendar ), so as a general rule we need an instance to determine it.




getTypeNames
public Collection<QName> getTypeNames()(Code)
Returns XML Schema type names if the bean is mapped from a complex/simple type of XML Schema.

This is an ugly necessity to correctly handle the type substitution semantics of XML Schema.

A single Java class maybe mapped to more than one XML types. All the types listed here are recognized when we are unmarshalling XML.

null if the class is not bound to a named schema type.




hasAfterMarshalMethod
final public boolean hasAfterMarshalMethod()(Code)
True if JaxBeanInfo.jaxbType has the lifecycle method.



hasAfterUnmarshalMethod
final public boolean hasAfterUnmarshalMethod()(Code)
True if JaxBeanInfo.jaxbType has the lifecycle method.



hasBeforeMarshalMethod
final public boolean hasBeforeMarshalMethod()(Code)
True if JaxBeanInfo.jaxbType has the lifecycle method.



hasBeforeUnmarshalMethod
final public boolean hasBeforeUnmarshalMethod()(Code)
True if JaxBeanInfo.jaxbType has the lifecycle method.



hasElementOnlyContentModel
final public boolean hasElementOnlyContentModel()(Code)
True if this bean has an element-only content model.

If this flag is true, the unmarshaller can work faster by ignoring whitespaces more efficiently.




hasElementOnlyContentModel
final protected void hasElementOnlyContentModel(boolean value)(Code)
True if this bean has an element-only content model.

Should be considered immutable, though I can't mark it final because it cannot be computed in this constructor.




invokeAfterUnmarshalMethod
final public void invokeAfterUnmarshalMethod(UnmarshallerImpl unm, Object child, Object parent) throws SAXException(Code)
Invokes the afterUnmarshal method if applicable.



invokeBeforeUnmarshalMethod
final public void invokeBeforeUnmarshalMethod(UnmarshallerImpl unm, Object child, Object parent) throws SAXException(Code)
Invokes the beforeUnmarshal method if applicable.



isElement
final public boolean isElement()(Code)
Returns true if the bean is mapped to/from an XML element.

When this method returns true, JaxBeanInfo.getElementNamespaceURI(Object) and JaxBeanInfo.getElementLocalName(Object) returns the element name of the bean.




isImmutable
final public boolean isImmutable()(Code)
Returns true if the bean is immutable.

If this is true, Binder won't try to ueuse this object, and the unmarshaller won't create a new instance of it before it starts.




link
protected void link(JAXBContextImpl grammar)(Code)
Called after all the JaxBeanInfo s are created.
Parameters:
  grammar -



lookForLifecycleMethods
public boolean lookForLifecycleMethods()(Code)
This method is used to determine which of the sub-classes should be interrogated for the existence of lifecycle methods. true if the un|marshaller should look for lifecycle methodson this beanInfo, false otherwise.



reset
abstract public boolean reset(BeanT o, UnmarshallingContext context) throws SAXException(Code)
Resets the object to the initial state, as if the object is created fresh.

This is used to reuse an existing object for unmarshalling.
Parameters:
  context - used for reporting any errors.true if the object was successfuly resetted.False if the object is not resettable, in which case the object will bediscarded and new one will be created.

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.
throws:
  SAXException - as a result of reporting an error, the context may throw a SAXException.




serializeAttributes
abstract public void serializeAttributes(BeanT o, XMLSerializer target) throws SAXException, IOException, XMLStreamException(Code)
Serializes attributes into the specified target.



serializeBody
abstract public void serializeBody(BeanT o, XMLSerializer target) throws SAXException, IOException, XMLStreamException(Code)
Serializes child elements and texts into the specified target.



serializeRoot
abstract public void serializeRoot(BeanT o, XMLSerializer target) throws SAXException, IOException, XMLStreamException(Code)
Serializes the bean as the root element.

In 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) .




serializeURIs
abstract public void serializeURIs(BeanT o, XMLSerializer target) throws SAXException(Code)
Declares all the namespace URIs this object is using at its top-level scope into the specified target.



setLifecycleFlags
final protected void setLifecycleFlags()(Code)
use reflection to determine which of the 4 object lifecycle methods exist on the JAXB bound type.



wrapUp
public void wrapUp()(Code)
Called at the end of the JAXBContext initialization phase to clean up any unnecessary references.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

w__w__w.___j_a_v__a2__s_._co_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.