|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.bind Class JAXBIntrospector
java.lang.Object javax.xml.bind.JAXBIntrospector
public abstract class JAXBIntrospector
- extends Object
提供对 JAXB 对象的 JAXB xml 绑定数据的访问。
最初,此类只用于从概念上说明 JAXB 应用程序开发人员如何访问 xml 绑定信息,与绑定模型是从 java 到 schema 还是从 schema 到 java 无关。由于访问与 JAXB 元素相关的 XML 元素名称是经常被请求的功能,所以我们将演示如何访问此绑定信息。获取 JAXBIntrospector
实例的工厂方法是 createJAXBIntrospector()
。
since | JAXB2.0 |
See also | createJAXBIntrospector() |
Provide access to JAXB xml binding data for a JAXB object.
Intially, the intent of this class is to just conceptualize how
a JAXB application developer can access xml binding information,
independent if binding model is java to schema or schema to java.
Since accessing the XML element name related to a JAXB element is
a highly requested feature, demonstrate access to this
binding information.
The factory method to get a JAXBIntrospector
instance is
JAXBContext.createJAXBIntrospector()
.
- Since:
- JAXB2.0
- See Also:
JAXBContext.createJAXBIntrospector()
Constructor Summary | |
---|---|
JAXBIntrospector()
|
Method Summary | |
---|---|
abstract QName |
getElementName(Object jaxbElement)
Get xml element qname for jaxbElement . |
static Object |
getValue(Object jaxbElement)
Get the element value of a JAXB element. |
abstract boolean |
isElement(Object object)
Return true iff object represents a JAXB element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
JAXBIntrospector()
英文文档:
JAXBIntrospector
public JAXBIntrospector()
Method Detail |
---|
abstract public boolean
isElement(Object object)
如果 object
表示一个 JAXB 元素,则返回 true。
在以下情况中,参数 object
是一个 JAXB 元素:
- 它是
javax.xml.bind.JAXBElement
的实例。 object
的类是使用@
注释的。
See also | getElementName(Object) |
isElement
public abstract boolean isElement(Object object)
Return true iff
object
represents a JAXB element.Parameter
object
is a JAXB element for following cases:- It is an instance of
javax.xml.bind.JAXBElement
. - The class of
object
is annotated with@XmlRootElement
.
- It is an instance of
- See Also:
getElementName(Object)
abstract public javax.xml.namespace.QName
getElementName(Object jaxbElement)
获取 jaxbElement
的 xml 元素 qname。
jaxbElement |
#isElement(Object) 返回 true 的对象。 |
return |
与 jaxbElement 关联的 xml 元素 qname;如果 jaxbElement 不是 JAXB 元素,则返回 null。 |
getElementName
public abstract QName getElementName(Object jaxbElement)
Get xml element qname for
jaxbElement
.- Parameters:
jaxbElement
- is an object thatisElement(Object)
returned true.- Returns:
- xml element qname associated with jaxbElement;
null if
jaxbElement
is not a JAXB Element.
public static Object
getValue(Object jaxbElement)
获取 JAXB 元素的元素值。
对是与 javax.xml.bind.JAXBElement 实例一起使用还是与用 >@XmlRootElement 注释的 Java 类实例一起使用进行抽象的便捷方法。
jaxbElement | #isElement(Object) 返回 true 的对象。 |
return |
jaxbElement 的元素值。
|
getValue
public static Object getValue(Object jaxbElement)
Get the element value of a JAXB element.
Convenience method to abstract whether working with either a javax.xml.bind.JAXBElement instance or an instance of @XmlRootElement annotated Java class.
- Parameters:
jaxbElement
- object that #isElement(Object) returns true.- Returns:
- The element value of the
jaxbElement
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!