|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ctc.wstx.dtd.DTDAttribute
Base class for objects that contain attribute definitions from DTD. Sub-classes exists for specific typed attributes (enumeration-valued, non-CDATA ones); base class itself is used for attributes of type CDATA.
| Field Summary | |
static int |
DEF_DEFAULT
|
static int |
DEF_FIXED
|
static int |
DEF_IMPLIED
|
static int |
DEF_REQUIRED
|
protected java.lang.String |
mDefValue
Note: Can not be made final since validation code may want to trim it down a bit... |
protected int |
mDefValueType
|
protected NameKey |
mName
|
protected int |
mSpecialIndex
Index number amongst "special" attributes (required ones, attributes that have default values), if attribute is one: -1 if not. |
static int |
TYPE_CDATA
|
static int |
TYPE_ENTITIES
|
static int |
TYPE_ENTITY
|
static int |
TYPE_ENUMERATED
|
static int |
TYPE_ID
|
static int |
TYPE_IDREF
|
static int |
TYPE_IDREFS
|
static int |
TYPE_NMTOKEN
|
static int |
TYPE_NMTOKENS
|
static int |
TYPE_NOTATION
|
| Constructor Summary | |
DTDAttribute(NameKey name,
int defValueType,
java.lang.String defValue,
int specIndex)
|
|
| Method Summary | |
protected void |
checkEntity(InputProblemReporter rep,
java.lang.String id,
EntityDecl ent)
|
DTDAttribute |
cloneWith(int specIndex)
|
protected EntityDecl |
findEntityDecl(ElementValidator v,
char[] ch,
int start,
int len,
int hash)
|
int |
getDefaultType()
|
java.lang.String |
getDefaultValue()
|
NameKey |
getName()
|
int |
getSpecialIndex()
|
int |
getValueType()
Returns the value type of this attribute as an enumerated int to match type (CDATA, ...) |
java.lang.String |
getValueTypeString()
|
boolean |
isFixed()
|
boolean |
isRequired()
|
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. |
static boolean |
isSpecial(int defValueType)
|
boolean |
needsValidation()
|
protected void |
reportInvalidChar(ElementValidator v,
char c,
java.lang.String msg)
|
protected void |
reportParseError(ElementValidator v,
java.lang.String msg)
|
protected void |
reportParseError(InputProblemReporter rep,
java.lang.String msg)
|
java.lang.String |
toString()
|
boolean |
typeIsId()
|
boolean |
typeIsNotation()
|
void |
validate(ElementValidator v,
boolean normalize,
AttributeCollector ac,
int index)
Method called by the ElementValidator
to let the attribute do necessary normalization and/or validation
for the value. |
void |
validateDefault(InputProblemReporter rep,
boolean normalize)
Method called by the ElementValidator
to ask attribute to verify that the default it has (if any) is
valid for such type. |
protected java.lang.String |
validateDefaultName(InputProblemReporter rep,
boolean normalize)
|
protected java.lang.String |
validateDefaultNames(InputProblemReporter rep,
boolean normalize)
|
protected java.lang.String |
validateDefaultNmToken(InputProblemReporter rep,
boolean normalize)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int TYPE_CDATA
public static final int TYPE_ENUMERATED
public static final int TYPE_ID
public static final int TYPE_IDREF
public static final int TYPE_IDREFS
public static final int TYPE_ENTITY
public static final int TYPE_ENTITIES
public static final int TYPE_NOTATION
public static final int TYPE_NMTOKEN
public static final int TYPE_NMTOKENS
public static final int DEF_DEFAULT
public static final int DEF_IMPLIED
public static final int DEF_REQUIRED
public static final int DEF_FIXED
protected final NameKey mName
protected final int mSpecialIndex
protected final int mDefValueType
protected java.lang.String mDefValue
Note: Can not be made final since validation code may want to trim it down a bit...
| Constructor Detail |
public DTDAttribute(NameKey name,
int defValueType,
java.lang.String defValue,
int specIndex)
| Method Detail |
public DTDAttribute cloneWith(int specIndex)
public final NameKey getName()
public final java.lang.String toString()
public final int getDefaultType()
public final java.lang.String getDefaultValue()
public final boolean isSpecial()
public static boolean isSpecial(int defValueType)
public final boolean isRequired()
public final boolean isFixed()
public final int getSpecialIndex()
public final boolean needsValidation()
public int getValueType()
Note:
public java.lang.String getValueTypeString()
public boolean typeIsId()
public boolean typeIsNotation()
public void validate(ElementValidator v,
boolean normalize,
AttributeCollector ac,
int index)
throws WstxException
ElementValidator
to let the attribute do necessary normalization and/or validation
for the value.
WstxException
public void validateDefault(InputProblemReporter rep,
boolean normalize)
throws WstxException
ElementValidator
to ask attribute to verify that the default it has (if any) is
valid for such type.
WstxException
protected java.lang.String validateDefaultName(InputProblemReporter rep,
boolean normalize)
throws WstxException
WstxException
protected java.lang.String validateDefaultNames(InputProblemReporter rep,
boolean normalize)
throws WstxException
WstxException
protected java.lang.String validateDefaultNmToken(InputProblemReporter rep,
boolean normalize)
throws WstxException
WstxException
protected EntityDecl findEntityDecl(ElementValidator v,
char[] ch,
int start,
int len,
int hash)
throws WstxException
WstxException
protected void checkEntity(InputProblemReporter rep,
java.lang.String id,
EntityDecl ent)
throws WstxException
WstxException
protected void reportInvalidChar(ElementValidator v,
char c,
java.lang.String msg)
throws WstxException
WstxException
protected void reportParseError(ElementValidator v,
java.lang.String msg)
throws WstxException
WstxException
protected void reportParseError(InputProblemReporter rep,
java.lang.String msg)
throws WstxException
WstxException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||