Class ValueDecoderFactory.DecoderBase
java.lang.Object
org.codehaus.stax2.typed.TypedValueDecoder
org.codehaus.stax2.ri.typed.ValueDecoderFactory.DecoderBase
- Direct Known Subclasses:
ValueDecoderFactory.BooleanDecoder, ValueDecoderFactory.DecimalDecoder, ValueDecoderFactory.DoubleDecoder, ValueDecoderFactory.FloatDecoder, ValueDecoderFactory.IntDecoder, ValueDecoderFactory.IntegerDecoder, ValueDecoderFactory.LongDecoder, ValueDecoderFactory.QNameDecoder
- Enclosing class:
ValueDecoderFactory
There are some things common to all textual decoders (like
white space trimming).
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intPointer to the next character to check, within lexical value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected IllegalArgumentExceptionconstructInvalidValue(char[] lexical, int startOffset, int end) protected IllegalArgumentExceptionconstructInvalidValue(String lexical) abstract StringgetType()voidMethod called if the value to decode does not contain any non-white space characters (including the case where typed accessor is called for an empty element).protected StringlexicalDesc(char[] lexical, int startOffset, int end) protected StringlexicalDesc(String lexical) protected static final intparseInt(char[] digitChars, int start, int end) Fast method for parsing integers that are known to fit into regular 32-bit signed int type.protected static final intparseInt(int num, char[] digitChars, int start, int end) protected static final intprotected static final intprotected static final longparseLong(char[] digitChars, int start, int end) protected static final longprotected intskipSignAndZeroes(char[] lexical, char ch, boolean hasSign, int start, int end) protected intskipSignAndZeroes(String lexical, char ch, boolean hasSign, int end) protected voidverifyDigits(char[] lexical, int start, int end, int ptr) protected voidverifyDigits(String lexical, int start, int end) Method called to check that remaining String consists of zero or more digitsMethods inherited from class TypedValueDecoder
decode, decode
-
Field Details
-
mNextPtr
protected int mNextPtrPointer to the next character to check, within lexical value
-
-
Constructor Details
-
DecoderBase
protected DecoderBase()
-
-
Method Details
-
getType
-
handleEmptyValue
public void handleEmptyValue()Method called if the value to decode does not contain any non-white space characters (including the case where typed accessor is called for an empty element).- Specified by:
handleEmptyValuein classTypedValueDecoder
-
verifyDigits
Method called to check that remaining String consists of zero or more digits -
verifyDigits
protected void verifyDigits(char[] lexical, int start, int end, int ptr) -
skipSignAndZeroes
- Returns:
- Numeric value of the first non-zero character (or, in case of a zero value, zero)
-
skipSignAndZeroes
protected int skipSignAndZeroes(char[] lexical, char ch, boolean hasSign, int start, int end) -
parseInt
protected static final int parseInt(char[] digitChars, int start, int end) Fast method for parsing integers that are known to fit into regular 32-bit signed int type. This means that length is between 1 and 9 digits (inclusive)- Returns:
- Parsed integer value
-
parseInt
protected static final int parseInt(int num, char[] digitChars, int start, int end) -
parseInt
-
parseInt
-
parseLong
protected static final long parseLong(char[] digitChars, int start, int end) -
parseLong
-
constructInvalidValue
-
constructInvalidValue
-
lexicalDesc
-
lexicalDesc
-
_clean
-