@User public abstract class SelectedIntegersAttribute extends TypedAttribute<Integer>
<!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!)
TypedAttribute.__PreAtts, TypedAttribute.SafeValues
TypedNode.ParseListener<E extends TypedElement<?,?>>
__preAtts, emptyAttributes, mutable, safeValues, specified, value
Modifier | Constructor and Description |
---|---|
protected |
SelectedIntegersAttribute() |
protected |
SelectedIntegersAttribute(@Opt Integer value) |
protected |
SelectedIntegersAttribute(@Opt String value) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkValue(Integer i)
Check routine for the validity of the attributes' intended value.
|
void |
encode(EncodingOutputStream out,
TypedExtension ext)
DOCME
|
int |
getMax()
DOCME
|
int |
getMin()
DOCME
|
String |
getStringValue(Integer v)
Returns the textual representation of a possible attribute value (not null),
as it would be contained literally in a possible XML text representation.
|
String |
getTypeString()
The definition text for the "type" of the attribute in the original DTD.
|
abstract SortedSet<Integer> |
getValidInts()
DOCME
|
boolean |
isValid(int i)
DOCME
|
static int |
parse(String vs)
Aux Method for parsing an integer to the base 10.
|
static int |
parse(String vs,
int base)
Aux Method for parsing an integer to a given base.
|
assertSetAttrValid, checkRequired, clearValue, find, find, getDefaultValue, getLocalName, getNamespaceName, getNamespaceURI, getStringValue, getTagName, getValue, isFixed, isOptional, isRequired, isSpecified, makeUnspecified, put, setValue
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
protected SelectedIntegersAttribute()
protected SelectedIntegersAttribute(@Opt @Opt Integer value) throws TdomAttributeSyntaxException
TdomAttributeSyntaxException
protected SelectedIntegersAttribute(@Opt @Opt String value) throws TdomAttributeSyntaxException
TdomAttributeSyntaxException
public String getTypeString()
TypedAttribute
getTypeString
in class TypedAttribute<Integer>
@User public boolean isValid(int i)
@User public int getMin()
@User public int getMax()
protected void checkValue(Integer i) throws TdomAttributeSyntaxException
TypedAttribute
#set_value(V)
method.
The value null
means "absent" for #IMPLIED
attributes and passes the test.checkValue
in class TypedAttribute<Integer>
i
- the value to test; maybe null.TdomAttributeSyntaxException
- iff the value does not match the type of the
XML attribute, including a forbidden Null.@User public static int parse(String vs, int base) throws IllegalArgumentException
NumberFormatException
to IllegalArgumentException
.IllegalArgumentException
@User public static int parse(String vs) throws IllegalArgumentException
NumberFormatException
to IllegalArgumentException
.IllegalArgumentException
@User public final String getStringValue(Integer v)
TypedAttribute
getStringValue
in class TypedAttribute<Integer>
public final void encode(EncodingOutputStream out, TypedExtension ext) throws IOException
encode
in class TypedNode<TypedExtension>
IOException
see also the complete user documentation .