Package eu.bandm.tools.tdom.runtime
Class NmTokensAttribute
- java.lang.Object
-
- eu.bandm.tools.tdom.runtime.TypedNode<TypedExtension>
-
- eu.bandm.tools.tdom.runtime.TypedAttribute<java.util.List<java.lang.String>>
-
- eu.bandm.tools.tdom.runtime.NmTokensAttribute
-
- Direct Known Subclasses:
Element_enumset.Attr_default
,IdRefsAttribute
public abstract class NmTokensAttribute extends TypedAttribute<java.util.List<java.lang.String>>
Implements an Attribute of "NMTOKENS
" type, which holds as its value a list of NMTOKEN tokens separated by blanks. See [XML 1.0], "3.3.1 Attribute Types" and production rule [8].See
NmTokenAttribute.checkNmToken(String)
andsplitValues(String)
for details of these definitions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.bandm.tools.tdom.runtime.TypedAttribute
TypedAttribute.__PreAtts, TypedAttribute.SafeValues
-
Nested classes/interfaces inherited from class eu.bandm.tools.tdom.runtime.TypedNode
TypedNode.ParseListener<E extends TypedElement<?,?>>
-
-
Field Summary
-
Fields inherited from class eu.bandm.tools.tdom.runtime.TypedAttribute
__preAtts, emptyAttributes, mutable, safeValues, specified, value
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NmTokensAttribute()
protected
NmTokensAttribute(@Opt java.lang.String value)
protected
NmTokensAttribute(@Opt java.util.List<java.lang.String> value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkValue(@Opt java.util.List<java.lang.String> values)
Check routine for the validity of the attributes' intended value.(package private) void
decode(DecodingInputStream in, TypedExtension ext)
DOCMEvoid
encode(EncodingOutputStream out, TypedExtension ext)
DOCMEprotected static java.util.List<java.lang.String>
findSplit(org.xml.sax.Attributes attrs, NamespaceName name)
DOCME@Opt java.lang.String
getStringValue(@Opt java.util.List<java.lang.String> v)
Returns the textual representation of a possible attribute value (not null), as it would be contained literally in a possible XML text representation.java.lang.String
getTypeString()
The definition text for the "type" of the attribute in the original DTD.protected boolean
mustBeNameToken()
Overridden by subclass.static @Opt java.util.List<java.lang.String>
splitValues(@Opt java.lang.String text)
Used from extern as auxiliary method.-
Methods inherited from class eu.bandm.tools.tdom.runtime.TypedAttribute
assertSetAttrValid, checkRequired, clearValue, find, find, getDefaultValue, getLocalName, getNamespaceName, getNamespaceURI, getStringValue, getTagName, getValue, isFixed, isOptional, isRequired, isSpecified, makeUnspecified, put, setValue
-
Methods inherited from class eu.bandm.tools.tdom.runtime.TypedNode
asBigDecimal, asBigDecimal, asBigDecimal, asBigDecimal, asBigInteger, asBigInteger, asBigInteger, asBigInteger, asBoolean, asBoolean, asDouble, asDouble, asDouble, asDouble, asFloat, asFloat, asFloat, asFloat, asHexInt, asHexInt, asHexInt, asHexInt, asInt, asInt, asInt, asInt, asLong, asLong, asLong, asLong, asTrimmedString, asTrimmedString, asTrimmedString, asTrimmedString, checkPlus, checkPlus, checkStar, checkStar, checkStrict, encode, encodeOptional, encodePlus, encodePlus, encodeStar, encodeStar, extractEthereals, getLocation, getPCData, setLocation, setLocation, setLocation
-
-
-
-
Constructor Detail
-
NmTokensAttribute
protected NmTokensAttribute()
-
NmTokensAttribute
protected NmTokensAttribute(@Opt @Opt java.util.List<java.lang.String> value) throws TdomAttributeSyntaxException
- Throws:
TdomAttributeSyntaxException
-
NmTokensAttribute
protected NmTokensAttribute(@Opt @Opt java.lang.String value) throws TdomAttributeSyntaxException
- Throws:
TdomAttributeSyntaxException
-
-
Method Detail
-
checkValue
protected void checkValue(@Opt @Opt java.util.List<java.lang.String> values) throws TdomAttributeSyntaxException
Description copied from class:TypedAttribute
Check routine for the validity of the attributes' intended value. Is a call-back, implemented by the sub-classes. Is called only here, by two constructors and the#set_value(V)
method. The valuenull
means "absent" for#IMPLIED
attributes and passes the test.- Specified by:
checkValue
in classTypedAttribute<java.util.List<java.lang.String>>
- Parameters:
values
- the value to test; maybe null.- Throws:
TdomAttributeSyntaxException
- iff the value does not match the type of the XML attribute, including a forbidden Null.
-
getTypeString
public java.lang.String getTypeString()
Description copied from class:TypedAttribute
The definition text for the "type" of the attribute in the original DTD.- Specified by:
getTypeString
in classTypedAttribute<java.util.List<java.lang.String>>
-
mustBeNameToken
protected boolean mustBeNameToken()
Overridden by subclass.
-
splitValues
@Opt public static @Opt java.util.List<java.lang.String> splitValues(@Opt @Opt java.lang.String text)
Used from extern as auxiliary method. The definiton [XML 1.0], production rule [8] requires EXACTLY ONE SPACE between tokens, and tokens must be at least one character long.FIXME the current impl gives strange diagnosis for more blanks, as in
att="b⎵⎵⎵c"
.
-
encode
public final void encode(EncodingOutputStream out, TypedExtension ext) throws java.io.IOException
DOCME- Specified by:
encode
in classTypedNode<TypedExtension>
- Throws:
java.io.IOException
-
decode
final void decode(DecodingInputStream in, TypedExtension ext) throws java.io.IOException, TdomAttributeSyntaxException
DOCME- Specified by:
decode
in classTypedAttribute<java.util.List<java.lang.String>>
- Throws:
java.io.IOException
TdomAttributeSyntaxException
-
findSplit
protected static java.util.List<java.lang.String> findSplit(org.xml.sax.Attributes attrs, NamespaceName name)
DOCME
-
getStringValue
@Opt public final @Opt java.lang.String getStringValue(@Opt @Opt java.util.List<java.lang.String> v)
Description copied from class:TypedAttribute
Returns the textual representation of a possible attribute value (not null), as it would be contained literally in a possible XML text representation. Since the textual representation of a String is the string itself, this method is relevant for enumeration types only (Later: also for "entity" types, but these are not yet supported.)- Specified by:
getStringValue
in classTypedAttribute<java.util.List<java.lang.String>>
- Returns:
- (never null) the textual representation of this attribute value, as it would be contained literally in a possible XML text representation.
-
-