Java Doc for JAXBElement.java in  » 6.0-JDK-Modules » jaxb-api » javax » xml » bind » 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 » jaxb api » javax.xml.bind 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.xml.bind.JAXBElement

JAXBElement
public class JAXBElement implements Serializable(Code)

JAXB representation of an Xml Element.

This class represents information about an Xml Element from both the element declaration within a schema and the element instance value within an xml document with the following properties

  • element's xml tag name
  • value represents the element instance's atttribute(s) and content model
  • element declaration's declaredType (xs:element @type attribute)
  • scope of element declaration
  • boolean nil property. (element instance's xsi:nil attribute)

The declaredType and scope property are the JAXB class binding for the xml type definition.

Scope is either GlobalScope or the Java class representing the complex type definition containing the schema element declaration.

There is a property constraint that if value is null, then nil must be true. The converse is not true to enable representing a nil element with attribute(s). If nil is true, it is possible that value is non-null so it can hold the value of the attributes associated with a nil element.


author:
   Kohsuke Kawaguchi, Joe Fialli
since:
   JAXB 2.0

Inner Class :final public static class GlobalScope

Field Summary
final protected  Class<T>declaredType
     Java datatype binding for xml element declaration's type.
final protected  QNamename
    
protected  booleannil
     true iff the xml element instance has xsi:nil="true".
final protected  Classscope
     Scope of xml element declaration representing this xml element instance. Can be one of the following values: - GlobalScope for global xml element declaration. - local element declaration has a scope set to the Java class representation of complex type defintion containing xml element declaration.
protected  Tvalue
     xml element value.

Constructor Summary
public  JAXBElement(QName name, Class<T> declaredType, Class scope, T value)
    
public  JAXBElement(QName name, Class<T> declaredType, T value)
     Construct an xml element instance.

Method Summary
public  Class<T>getDeclaredType()
     Returns the Java binding of the xml element declaration's type attribute.
public  QNamegetName()
     Returns the xml element tag name.
public  ClassgetScope()
     Returns scope of xml element declaration.
public  TgetValue()
    
public  booleanisGlobalScope()
     Returns true iff this xml element declaration is global.
public  booleanisNil()
    

Returns true iff this element instance content model is nil.

This property always returns true when JAXBElement.getValue() is null. Note that the converse is not true, when this property is true, JAXBElement.getValue() can contain a non-null value for attribute(s).

public  booleanisTypeSubstituted()
     Returns true iff this xml element instance's value has a different type than xml element declaration's declared type.
public  voidsetNil(boolean value)
    
public  voidsetValue(T t)
    

Set the content model and attributes of this xml element.

When this property is set to null, isNil() must by true.


Field Detail
declaredType
final protected Class<T> declaredType(Code)
Java datatype binding for xml element declaration's type.



name
final protected QName name(Code)
xml element tag name



nil
protected boolean nil(Code)
true iff the xml element instance has xsi:nil="true".



scope
final protected Class scope(Code)
Scope of xml element declaration representing this xml element instance. Can be one of the following values: - GlobalScope for global xml element declaration. - local element declaration has a scope set to the Java class representation of complex type defintion containing xml element declaration.



value
protected T value(Code)
xml element value. Represents content model and attributes of an xml element instance.




Constructor Detail
JAXBElement
public JAXBElement(QName name, Class<T> declaredType, Class scope, T value)(Code)

Construct an xml element instance.


Parameters:
  name - Java binding of xml element tag name
Parameters:
  declaredType - Java binding of xml element declaration's type
Parameters:
  scope - Java binding of scope of xml element declaration.Passing null is the same as passing GlobalScope.class
Parameters:
  value - Java instance representing xml element's value.
See Also:   JAXBElement.getScope()
See Also:   JAXBElement.isTypeSubstituted()



JAXBElement
public JAXBElement(QName name, Class<T> declaredType, T value)(Code)
Construct an xml element instance. This is just a convenience method for new JAXBElement(name,declaredType,GlobalScope.class,value)




Method Detail
getDeclaredType
public Class<T> getDeclaredType()(Code)
Returns the Java binding of the xml element declaration's type attribute.



getName
public QName getName()(Code)
Returns the xml element tag name.



getScope
public Class getScope()(Code)
Returns scope of xml element declaration.
See Also:   JAXBElement.isGlobalScope() GlobalScope.class if this element is of global scope.



getValue
public T getValue()(Code)

Return the content model and attribute values for this element.

See JAXBElement.isNil() for a description of a property constraint when this value is null




isGlobalScope
public boolean isGlobalScope()(Code)
Returns true iff this xml element declaration is global.



isNil
public boolean isNil()(Code)

Returns true iff this element instance content model is nil.

This property always returns true when JAXBElement.getValue() is null. Note that the converse is not true, when this property is true, JAXBElement.getValue() can contain a non-null value for attribute(s). It is valid for a nil xml element to have attribute(s).




isTypeSubstituted
public boolean isTypeSubstituted()(Code)
Returns true iff this xml element instance's value has a different type than xml element declaration's declared type.



setNil
public void setNil(boolean value)(Code)

Set whether this element has nil content.


See Also:   JAXBElement.isNil()



setValue
public void setValue(T t)(Code)

Set the content model and attributes of this xml element.

When this property is set to null, isNil() must by true. Details of constraint are described at JAXBElement.isNil() .
See Also:   JAXBElement.isTypeSubstituted()




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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.