Package com.ctc.wstx.dtd
Class DefaultAttrValue
java.lang.Object
com.ctc.wstx.dtd.DefaultAttrValue
Simple container class used to contain information about the default
value for an attribute. Although for most use cases a simple String
would suffice, there are cases where additional information is needed
(especially status of 'broken' default values, which only need to be
reported should the default value be needed).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int(package private) final intFor now, let's only keep track of the first undeclared entity: can be extended if necessary.private StringActual expanded textual content of the default attribute value; normalized if appropriate in this mode.(package private) static final DefaultAttrValue(package private) static final DefaultAttrValue -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddUndeclaredEntity(String name, Location loc, boolean isPe) voidaddUndeclaredGE(String name, Location loc) voidaddUndeclaredPE(String name, Location loc) static DefaultAttrValuestatic DefaultAttrValuestatic DefaultAttrValuestatic DefaultAttrValuegetValue()booleanbooleanbooleanisFixed()booleanbooleanMethod used by the element to figure out if attribute needs "special" checking; basically if it's required, and/or has a default value.voidreportUndeclared(org.codehaus.stax2.validation.ValidationContext ctxt, org.codehaus.stax2.validation.XMLValidator dtd) void
-
Field Details
-
DEF_DEFAULT
public static final int DEF_DEFAULT- See Also:
-
DEF_IMPLIED
public static final int DEF_IMPLIED- See Also:
-
DEF_REQUIRED
public static final int DEF_REQUIRED- See Also:
-
DEF_FIXED
public static final int DEF_FIXED- See Also:
-
sImplied
-
sRequired
-
mDefValueType
final int mDefValueType -
mValue
Actual expanded textual content of the default attribute value; normalized if appropriate in this mode. Note that all entities have been expanded: if a GE/PE was undefined, and no fatal errors were reported (non-validating mode), the references were just silently removed, and matching entries added tomUndeclaredEntity -
mUndeclaredEntity
For now, let's only keep track of the first undeclared entity: can be extended if necessary.
-
-
Constructor Details
-
DefaultAttrValue
private DefaultAttrValue(int defValueType)
-
-
Method Details
-
constructImplied
-
constructRequired
-
constructFixed
-
constructOptional
-
setValue
-
addUndeclaredPE
-
addUndeclaredGE
-
reportUndeclared
public void reportUndeclared(org.codehaus.stax2.validation.ValidationContext ctxt, org.codehaus.stax2.validation.XMLValidator dtd) throws XMLStreamException - Throws:
XMLStreamException
-
hasUndeclaredEntities
public boolean hasUndeclaredEntities() -
getValue
-
getValueIfOk
- Returns:
- Expanded default value String, if there were no problems (no undeclared entities), or null to indicate there were problems. In latter case, caller is to figure out exact type of the problem and report this appropriately to the application.
-
isRequired
public boolean isRequired() -
isFixed
public boolean isFixed() -
hasDefaultValue
public boolean hasDefaultValue() -
isSpecial
public boolean isSpecial()Method used by the element to figure out if attribute needs "special" checking; basically if it's required, and/or has a default value. In both cases missing the attribute has specific consequences, either exception or addition of a default value. -
addUndeclaredEntity
-