public interface TypeInfo
TypeInfo接口代表一个类型从
Element或
Attr节点的引用,在与文档相关联的模式指定。类型是一对一的命名空间URI和名称的属性,而取决于文档的架构。
如果文档的架构是一个XML DTD [ XML 1.0 ],值计算如下:
Attr节点的引用,typeNamespace是"http://www.w3.org/TR/REC-xml"和typeName表示在[ XML Information Set ]的[属性类型]财产。如果没有声明的属性,typeNamespace和typeName是null。Element节点的引用,typeNamespace和typeName是null。如果文档的架构是一个XML架构[ XML Schema Part 1 ],计算的值如下使用后架构验证Infoset的贡献(也被称为氨基酸的贡献):
null。注:在写作的时候,XML Schema规范不需要揭露声明的类型。因此,DOM实现可能选择不如果有效无效提供类型信息。
注:其他模式语言在W3C的范围和应该定义如何代表自己的类型系统使用TypeInfo。
| Modifier and Type | Field and Description |
|---|---|
static int |
DERIVATION_EXTENSION
如果文档的架构是一个XML架构[
XML Schema Part 1 ],这个常数的推导
extension代表。
|
static int |
DERIVATION_LIST
如果文档的架构是一个XML架构[
XML Schema Part 1 ],这个常数代表
list。
|
static int |
DERIVATION_RESTRICTION
|
static int |
DERIVATION_UNION
如果文档的架构是一个XML架构[
XML Schema Part 1 ],如果简单类型都是常数,代表
union。
|
| Modifier and Type | Method and Description |
|---|---|
String |
getTypeName()
一个类型的名称申报相关的元素或属性,或
null如果未知。
|
String |
getTypeNamespace()
该类型的命名空间中声明的相关元素或属性或
null如果元素不如果没有命名空间信息是已申报或。
|
boolean |
isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
此方法返回,如果引用类型定义之间有一个派生,即
|
static final int DERIVATION_RESTRICTION
static final int DERIVATION_EXTENSION
static final int DERIVATION_UNION
DERIVATION_RESTRICTION
DERIVATION_EXTENSION,来源于
DERIVATION_RESTRICTION其他类型定义,T1有{ }和各种联盟的一个{成员类型定义}是T2。注意,T1可以作为参考类型定义相同,T2可以作为其他类型定义相同。
static final int DERIVATION_LIST
DERIVATION_RESTRICTION
DERIVATION_EXTENSION,来源于
DERIVATION_RESTRICTION的其他类型的定义,T1有{ }各种清单,和T2是{项类型定义}。注意,T1可以作为参考类型定义相同,T2可以作为其他类型定义相同。
String getTypeName()
null如果未知。
String getTypeNamespace()
null如果元素不如果没有命名空间信息是已申报或。
boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
TypeInfo该方法被调用,和其他类型的定义,即一个作为参数传递。
typeNamespaceArg -其他类型定义的命名空间。
typeNameArg -其他类型定义的名称。
derivationMethod -和条件施加在两个类型派生类型,在这个接口提供的常数列表描述。
false。如果文档的架构是一个XML模式的方法将引用类型的定义是来自其他类型的定义根据推导参数返回
true。如果参数值是
0(无位设置为
1为
derivationMethod参数),该方法将返回
true如果其他类型的定义可以被检索的基类型定义} {任何组合达成,{项类型定义}或{ },成员类型定义的引用类型的定义。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.