T
- the property typepublic class XmlReadingProperty<T> extends Object
DocumentBuilderFactory
and properties of
SAXParser
and XMLReader
in a typed way.
While this class offers read support only, the extended class
XmlReadingWritableProperty
shall be used for read-write accessible
properties.
Constructor and Description |
---|
XmlReadingProperty(String name)
Creates a new
XmlReadingProperty instance. |
Modifier and Type | Method and Description |
---|---|
T |
get(DocumentBuilderFactory documentBuilderFactory)
Allows the user to retrieve specific attributes on the underlying
implementation.
|
T |
get(SAXParser saxParser)
Returns the particular property requested for in the underlying
implementation of
XMLReader . |
T |
get(XMLReader xmlReader)
Look up the value of a property.
|
String |
getName()
Property Name
|
public XmlReadingProperty(String name)
XmlReadingProperty
instance.name
- Property Name@Nullable public T get(DocumentBuilderFactory documentBuilderFactory)
documentBuilderFactory
- the document builder factoryIllegalArgumentException
- thrown if the underlying implementation
doesn't recognize the attribute.DocumentBuilderFactory.getAttribute(String)
@Nullable public T get(SAXParser saxParser) throws SAXNotRecognizedException, SAXNotSupportedException
XMLReader
.saxParser
- the SAX parserSAXNotRecognizedException
- when the underlying XMLReader
does
not recognize the property name.SAXNotSupportedException
- when the underlying XMLReader
recognizes the property name but doesn't
support the property.XMLReader.getProperty(java.lang.String)
@Nullable public T get(XMLReader xmlReader) throws SAXNotRecognizedException, SAXNotSupportedException
It is possible for a XMLReader
to recognize a property name but
temporarily be unable to return its value. Some property values may be
available only in specific contexts, such as before, during, or after a
parse.
XMLReader
s are not required to recognize any specific property names.
xmlReader
- the XML readerSAXNotRecognizedException
- if the property value can't be assigned or
retrieved.SAXNotSupportedException
- when xmlReader
recognizes the
property name but cannot determine its
value at this time.public String getName()
Copyright © 2025. All rights reserved.