Package eu.bandm.tools.tdom.runtime
Class SelectedIntegersAttribute
java.lang.Object
eu.bandm.tools.tdom.runtime.TypedNode<TypedExtension>
eu.bandm.tools.tdom.runtime.TypedAttribute<Integer>
eu.bandm.tools.tdom.runtime.SelectedIntegersAttribute
Base class for all generated classes which realize an Attribute with a type
which is defined as a disjunction of integer values, like
<!ATTLIST element f (1 | 2 | 4 | 8 | 16 | -7) #IMPLIED >Normally this is realized as an
EnumerationAttribute
.
But this requires an Enumeration Type, and double conversions (item type to string to
integer, and backwards). So with the PI
<?tdom selectedIntegers element@f ?> -- or in case of common attributes: <?tdom selectedIntegers @f ?>.. this class can explicitly be chosen as a more convenient implementation. (This explicitness is required for backward and forward compatibility!)
-
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
ModifierConstructorDescriptionprotected
protected
SelectedIntegersAttribute
(@Opt Integer value) protected
SelectedIntegersAttribute
(@Opt String value) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Check routine for the validity of the attributes' intended value.(package private) final void
decode
(DecodingInputStream in, TypedExtension ext) DOCMEfinal void
encode
(EncodingOutputStream out, TypedExtension ext) DOCMEint
getMax()
DOCMEint
getMin()
DOCMEfinal String
Returns the textual representation of a possible attribute value (not null), as it would be contained literally in a possible XML text representation.The definition text for the "type" of the attribute in the original DTD.DOCMEboolean
isValid
(int i) DOCMEstatic int
Aux Method for parsing an integer to the base 10.static int
Aux Method for parsing an integer to a given base.Methods inherited from class eu.bandm.tools.tdom.runtime.TypedAttribute
assertSetAttrValid, 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 Details
-
SelectedIntegersAttribute
protected SelectedIntegersAttribute() -
SelectedIntegersAttribute
- Throws:
TdomAttributeSyntaxException
-
SelectedIntegersAttribute
- Throws:
TdomAttributeSyntaxException
-
-
Method Details
-
getTypeString
Description copied from class:TypedAttribute
The definition text for the "type" of the attribute in the original DTD.- Specified by:
getTypeString
in classTypedAttribute<Integer>
-
isValid
public boolean isValid(int i) DOCME -
getValidInts
DOCME -
getMin
public int getMin()DOCME -
getMax
public int getMax()DOCME -
checkValue
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 theTypedAttribute.setValue(V)
method. The valuenull
means "absent" for#IMPLIED
attributes and passes the test.- Specified by:
checkValue
in classTypedAttribute<Integer>
- Parameters:
i
- the value to test; maybe null.- Throws:
TdomAttributeSyntaxException
- iff the value does not match the type of the XML attribute, including a forbidden Null.
-
parse
Aux Method for parsing an integer to a given base. MapsNumberFormatException
toIllegalArgumentException
.- Throws:
IllegalArgumentException
-
parse
Aux Method for parsing an integer to the base 10. MapsNumberFormatException
toIllegalArgumentException
.- Throws:
IllegalArgumentException
-
getStringValue
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<Integer>
- Returns:
- (never null) the textual representation of this attribute value, as it would be contained literally in a possible XML text representation.
-
encode
DOCME- Specified by:
encode
in classTypedNode<TypedExtension>
- Throws:
IOException
-
decode
final void decode(DecodingInputStream in, TypedExtension ext) throws IOException, TdomAttributeSyntaxException DOCME- Specified by:
decode
in classTypedAttribute<Integer>
- Throws:
IOException
TdomAttributeSyntaxException
-