Top Description Inners Fields Constructors Methods
com.ctc.wstx.dtd

public final Class DefaultAttrValue

extends Object
Class Inheritance
Imports
java.text.MessageFormat, javax.xml.stream.Location, .XMLStreamException, org.codehaus.stax2.validation.ValidationContext, .XMLValidationProblem, .XMLValidator, com.ctc.wstx.cfg.ErrorConsts

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 and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
pack-priv final int
private DefaultAttrValue.UndeclaredEntity
mUndeclaredEntity

For now, let's only keep track of the first undeclared entity: can be extended if necessary.

private String
mValue

Actual expanded textual content of the default attribute value; normalized if appropriate in this mode.

pack-priv static final DefaultAttrValue
pack-priv static final DefaultAttrValue

Constructor Summary

AccessConstructor and Description
private
DefaultAttrValue(int defValueType)

Method Summary

Modifier and TypeMethod and Description
private void
addUndeclaredEntity(String name, Location loc, boolean isPe)

public void
public void
public static DefaultAttrValue
public static DefaultAttrValue
public static DefaultAttrValue
public static DefaultAttrValue
public String
public String

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.
getValueIfOk
()

public boolean
public boolean
public boolean
public boolean
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.

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEF_DEFAULTback to summary
public static final int DEF_DEFAULT
DEF_FIXEDback to summary
public static final int DEF_FIXED
DEF_IMPLIEDback to summary
public static final int DEF_IMPLIED
DEF_REQUIREDback to summary
public static final int DEF_REQUIRED
mDefValueTypeback to summary
pack-priv final int mDefValueType
mUndeclaredEntityback to summary
private DefaultAttrValue.UndeclaredEntity mUndeclaredEntity

For now, let's only keep track of the first undeclared entity: can be extended if necessary.

mValueback to summary
private String 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 to mUndeclaredEntity

sImpliedback to summary
pack-priv static final DefaultAttrValue sImplied
sRequiredback to summary
pack-priv static final DefaultAttrValue sRequired

Constructor Detail

DefaultAttrValueback to summary
private DefaultAttrValue(int defValueType)

Method Detail

addUndeclaredEntityback to summary
private void addUndeclaredEntity(String name, Location loc, boolean isPe)
addUndeclaredGEback to summary
public void addUndeclaredGE(String name, Location loc)
addUndeclaredPEback to summary
public void addUndeclaredPE(String name, Location loc)
constructFixedback to summary
public static DefaultAttrValue constructFixed()
constructImpliedback to summary
public static DefaultAttrValue constructImplied()
constructOptionalback to summary
public static DefaultAttrValue constructOptional()
constructRequiredback to summary
public static DefaultAttrValue constructRequired()
getValueback to summary
public String getValue()
getValueIfOkback to summary
public String getValueIfOk()
Returns:String

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.

hasDefaultValueback to summary
public boolean hasDefaultValue()
hasUndeclaredEntitiesback to summary
public boolean hasUndeclaredEntities()
isFixedback to summary
public boolean isFixed()
isRequiredback to summary
public boolean isRequired()
isSpecialback to summary
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.

reportUndeclaredback to summary
public void reportUndeclared(ValidationContext ctxt, XMLValidator dtd) throws XMLStreamException
setValueback to summary
public void setValue(String v)
com.ctc.wstx.dtd back to summary

pack-priv final Class DefaultAttrValue.UndeclaredEntity

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv final Location
pack-priv final String

Constructor Summary

AccessConstructor and Description
pack-priv
UndeclaredEntity(String name, Location loc, boolean isPe)

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mIsPeback to summary
pack-priv final boolean mIsPe
mLocationback to summary
pack-priv final Location mLocation
mNameback to summary
pack-priv final String mName

Constructor Detail

UndeclaredEntityback to summary
pack-priv UndeclaredEntity(String name, Location loc, boolean isPe)

Method Detail

reportUndeclaredback to summary
public void reportUndeclared(ValidationContext ctxt, XMLValidator dtd) throws XMLStreamException