public final class DTDElement extends Object
Notes about thread-safety: this class is not thread-safe, since it does not have to be, in general case. That is, the only instances that can be shared are external subset instances, and those are used in read-only manner (with the exception of temporary arrays constructed on-demand).
Modifier and Type | Method and Description |
---|---|
DTDAttribute |
addAttribute(InputProblemReporter rep,
PrefixedName attrName,
int valueType,
DefaultAttrValue defValue,
WordResolver enumValues,
boolean fullyValidate)
Method called by DTD parser when it has read information about
an attribute that belong to this element
|
DTDAttribute |
addNsDefault(InputProblemReporter rep,
PrefixedName attrName,
int valueType,
DefaultAttrValue defValue,
boolean fullyValidate)
Method called to add a definition of a namespace-declaration
pseudo-attribute with a default value.
|
boolean |
attrsNeedValidation() |
static DTDElement |
createDefined(ReaderConfig cfg,
Location loc,
PrefixedName name,
StructValidator val,
int allowedContent)
Method called to create an actual element definition, matching
an ELEMENT directive in a DTD subset.
|
static DTDElement |
createPlaceholder(ReaderConfig cfg,
Location loc,
PrefixedName name)
Method called to create a "placeholder" element definition, needed to
contain attribute definitions.
|
DTDElement |
define(Location loc,
StructValidator val,
int allowedContent)
Method called on placeholder element, to create a real instance that
has all attribute definitions placeholder had (it'll always have at
least one -- otherwise no placeholder was needed).
|
void |
defineFrom(InputProblemReporter rep,
DTDElement definedElem,
boolean fullyValidate)
Method called to "upgrade" a placeholder using a defined element,
including adding attributes.
|
int |
getAllowedContent() |
int |
getAllowedContentIfSpace()
Specialized accessor used by non-validating but typing 'validator':
essentially, used to figure out whether #PCDATA is allowed or not;
and based on that, return one of 2 allowable text values (only
space, or anything).
|
HashMap<PrefixedName,DTDAttribute> |
getAttributes() |
String |
getDisplayName() |
DTDAttribute |
getIdAttribute() |
Location |
getLocation() |
PrefixedName |
getName() |
DTDAttribute |
getNotationAttribute() |
protected HashMap<String,DTDAttribute> |
getNsDefaults() |
List<DTDAttribute> |
getSpecialAttrs() |
int |
getSpecialCount() |
StructValidator |
getValidator() |
boolean |
hasAttrDefaultValues() |
boolean |
hasFixedAttrs() |
boolean |
hasNsDefaults() |
boolean |
isDefined() |
void |
mergeMissingAttributesFrom(InputProblemReporter rep,
DTDElement other,
boolean fullyValidate) |
String |
toString() |
public static DTDElement createDefined(ReaderConfig cfg, Location loc, PrefixedName name, StructValidator val, int allowedContent)
public static DTDElement createPlaceholder(ReaderConfig cfg, Location loc, PrefixedName name)
public DTDElement define(Location loc, StructValidator val, int allowedContent)
public void defineFrom(InputProblemReporter rep, DTDElement definedElem, boolean fullyValidate) throws XMLStreamException
XMLStreamException
public DTDAttribute addAttribute(InputProblemReporter rep, PrefixedName attrName, int valueType, DefaultAttrValue defValue, WordResolver enumValues, boolean fullyValidate) throws XMLStreamException
XMLStreamException
public DTDAttribute addNsDefault(InputProblemReporter rep, PrefixedName attrName, int valueType, DefaultAttrValue defValue, boolean fullyValidate) throws XMLStreamException
rep
- Reporter to use to report non-fatal problemsfullyValidate
- Whether this is being invoked for actual DTD validation,
or just the "typing non-validator"XMLStreamException
public void mergeMissingAttributesFrom(InputProblemReporter rep, DTDElement other, boolean fullyValidate) throws XMLStreamException
XMLStreamException
public PrefixedName getName()
public String getDisplayName()
public Location getLocation()
public boolean isDefined()
public int getAllowedContent()
public int getAllowedContentIfSpace()
public HashMap<PrefixedName,DTDAttribute> getAttributes()
public int getSpecialCount()
public List<DTDAttribute> getSpecialAttrs()
public boolean attrsNeedValidation()
public boolean hasFixedAttrs()
public boolean hasAttrDefaultValues()
public DTDAttribute getIdAttribute()
public DTDAttribute getNotationAttribute()
public boolean hasNsDefaults()
public StructValidator getValidator()
protected HashMap<String,DTDAttribute> getNsDefaults()
Copyright © 2018 FasterXML. All rights reserved.