public abstract class TypeInfoProvider extends Object
ValidatorHandler类型信息。
一些模式语言,如W3C XML Schema,鼓励一个验证报告”式的“分配给每个属性/元。希望访问此类型信息的应用程序可以调用这个“接口”上定义的方法来访问此类类型的信息。
实施这一“界面”可以通过ValidatorHandler.getTypeInfoProvider()方法得到的。
TypeInfo
| Modifier | Constructor and Description |
|---|---|
protected |
TypeInfoProvider()
派生类的构造函数。
|
| Modifier and Type | Method and Description |
|---|---|
abstract TypeInfo |
getAttributeTypeInfo(int index)
返回指定属性的当前元素的不变的
TypeInfo对象。
|
abstract TypeInfo |
getElementTypeInfo()
返回当前元素的不变的
TypeInfo对象。
|
abstract boolean |
isIdAttribute(int index)
返回
true如果指定的属性确定为ID。
|
abstract boolean |
isSpecified(int index)
返回
false如果属性被添加的验证器。
|
public abstract TypeInfo getElementTypeInfo()
返回当前元素的不变的TypeInfo对象。
该方法只可由不同的事件或ContentHandler集的ValidatorHandler endElement事件中的应用。
当W3C XML Schema验证正在进行,在一个元素有一个联盟式的情况下,该TypeInfo返回被调用的getElementTypeInfo()从不同活动将结合型。返回的TypeInfo从EndElement事件调用将被用于验证元素实际的成员类型。
TypeInfo对象表示当前元素的类型。注意,打电话的人可以参考得到的
TypeInfo比回调范围更长。否则,该方法返回null如果验证器是无法确定某种原因当前元素的类型(例如,如果验证是从早期的错误恢复)
IllegalStateException -如果这方法是从其他
ContentHandler方法称为。
public abstract TypeInfo getAttributeTypeInfo(int index)
TypeInfo对象。
该方法只可称的ContentHandler集的ValidatorHandler startElement事件中的应用。
index -属性的索引。通过对
startElement回调
Attributes对象相同的指数。
TypeInfo表示指定的属性类型。注意,打电话的人可以参考得到的
TypeInfo比回调范围更长。否则,该方法返回null如果验证器是无法确定类型。
IndexOutOfBoundsException如果索引无效。
IllegalStateException -如果这方法是从其他
ContentHandler方法称为。
public abstract boolean isIdAttribute(int index)
true如果指定的属性确定为
正如何属性”确定为ID”是由语言图式。在W3C XML模式的情况下,这意味着该属性的实际类型是内置类型或其派生类型。
一个DocumentBuilder使用这些信息来正确地实现Attr.isId()。
该方法只可称的ContentHandler集的ValidatorHandler startElement事件中的应用。
index -属性的索引。通过对
startElement回调
Attributes对象相同的指数。
IndexOutOfBoundsException如果索引无效。
IllegalStateException -如果这方法是从其他
ContentHandler方法称为。
public abstract boolean isSpecified(int index)
false如果属性被添加的验证器。
这种方法提供了必要的信息,为DocumentBuilder确定什么DOM树应该从Attr.getSpecified()方法返回。
该方法只可称的ContentHandler集的ValidatorHandler startElement事件中的应用。
为验证一般的原则是如果属性在管道中原来存在的返回TRUE,FALSE如果它被验证补充。
index -属性的索引。通过对
startElement回调
Attributes对象相同的指数。
true如果之前验证过程的输入属性是存在的。
false如果属性被添加的验证器。
IndexOutOfBoundsException如果索引无效。
IllegalStateException -如果这方法是从其他
ContentHandler方法称为。
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.