Package org.apache.batik.parser
Class TimingParser
- java.lang.Object
-
- org.apache.batik.parser.AbstractParser
-
- org.apache.batik.parser.TimingParser
-
- All Implemented Interfaces:
Localizable,Parser
- Direct Known Subclasses:
ClockParser,TimingSpecifierParser
public abstract class TimingParser extends AbstractParser
An abstract base class for SMIL timing value parsers.- Version:
- $Id: TimingParser.java 1802297 2017-07-18 13:58:12Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description protected static intTIME_ACCESSKEYprotected static intTIME_ACCESSKEY_SVG12protected static intTIME_EVENTBASEprotected static intTIME_INDEFINITEprotected static intTIME_MEDIA_MARKERprotected static intTIME_OFFSETprotected static intTIME_REPEATprotected static intTIME_SYNCBASEprotected static intTIME_WALLCLOCKprotected booleanuseSVG11AccessKeysAllows the use of accessKey() timing specifiers with a single character, as specified in SVG 1.1.protected booleanuseSVG12AccessKeysAllows the use of accessKey() timing specifiers with a DOM 3 key name, as specified in SVG 1.2.-
Fields inherited from class org.apache.batik.parser.AbstractParser
BUNDLE_CLASSNAME, current, errorHandler, localizableSupport, reader
-
-
Constructor Summary
Constructors Constructor Description TimingParser(boolean useSVG11AccessKeys, boolean useSVG12AccessKeys)Creates a new TimingParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected floatparseClockValue()Parses a clock value.protected intparseDigits()Parses a sequence of digits and returns the integer.protected floatparseFraction()Parses a '.' and a sequence of digits and returns the float.protected java.lang.Object[]parseIDValue(boolean escaped)Parses a timing specifier that starts with a word.protected java.lang.StringparseName()Parses an XML name with optional escaping in the middle.protected floatparseOffset()Parses an offset value.protected java.lang.Object[]parseTimingSpecifier()Parses a timing specifier.protected floatparseUnit()Parses a time unit and returns the float for the multiplier.protected java.util.CalendarparseWallclockValue()Parses a wallclock value and returns it as aCalendar.-
Methods inherited from class org.apache.batik.parser.AbstractParser
createErrorMessage, doParse, formatMessage, getBundleClassName, getCurrent, getLocale, parse, parse, parse, reportCharacterExpectedError, reportError, reportUnexpectedCharacterError, setErrorHandler, setLocale, skipCommaSpaces, skipSpaces
-
-
-
-
Field Detail
-
TIME_OFFSET
protected static final int TIME_OFFSET
- See Also:
- Constant Field Values
-
TIME_SYNCBASE
protected static final int TIME_SYNCBASE
- See Also:
- Constant Field Values
-
TIME_EVENTBASE
protected static final int TIME_EVENTBASE
- See Also:
- Constant Field Values
-
TIME_REPEAT
protected static final int TIME_REPEAT
- See Also:
- Constant Field Values
-
TIME_ACCESSKEY
protected static final int TIME_ACCESSKEY
- See Also:
- Constant Field Values
-
TIME_ACCESSKEY_SVG12
protected static final int TIME_ACCESSKEY_SVG12
- See Also:
- Constant Field Values
-
TIME_MEDIA_MARKER
protected static final int TIME_MEDIA_MARKER
- See Also:
- Constant Field Values
-
TIME_WALLCLOCK
protected static final int TIME_WALLCLOCK
- See Also:
- Constant Field Values
-
TIME_INDEFINITE
protected static final int TIME_INDEFINITE
- See Also:
- Constant Field Values
-
useSVG11AccessKeys
protected boolean useSVG11AccessKeys
Allows the use of accessKey() timing specifiers with a single character, as specified in SVG 1.1.
-
useSVG12AccessKeys
protected boolean useSVG12AccessKeys
Allows the use of accessKey() timing specifiers with a DOM 3 key name, as specified in SVG 1.2.
-
-
Constructor Detail
-
TimingParser
public TimingParser(boolean useSVG11AccessKeys, boolean useSVG12AccessKeys)Creates a new TimingParser.- Parameters:
useSVG11AccessKeys- allows the use of accessKey() timing specifiers with a single characteruseSVG12AccessKeys- allows the use of accessKey() with a DOM 3 key name
-
-
Method Detail
-
parseTimingSpecifier
protected java.lang.Object[] parseTimingSpecifier() throws ParseException, java.io.IOExceptionParses a timing specifier. Returns an array of Objects of the form:- { TIME_OFFSET, offset }
- { TIME_SYNCBASE, offset, id, time-symbol }
- { TIME_EVENTBASE, offset, id, event-ref }
- { TIME_REPEAT, offset, id, repeat-count }
- { TIME_ACCESSKEY, offset, character }
- { TIME_ACCESSKEY_SVG12, offset, key-name }
- { TIME_MEDIA_MARKER, id, marker-name }
- { TIME_WALLCLOCK, wallclock-value }
- { TIME_INDEFINITE }
- Throws:
ParseExceptionjava.io.IOException
-
parseName
protected java.lang.String parseName() throws ParseException, java.io.IOExceptionParses an XML name with optional escaping in the middle.- Throws:
ParseExceptionjava.io.IOException
-
parseIDValue
protected java.lang.Object[] parseIDValue(boolean escaped) throws ParseException, java.io.IOExceptionParses a timing specifier that starts with a word.- Parameters:
escaped- whether a backslash appeared before this timing specifier- Throws:
ParseExceptionjava.io.IOException
-
parseClockValue
protected float parseClockValue() throws ParseException, java.io.IOExceptionParses a clock value.- Throws:
ParseExceptionjava.io.IOException
-
parseOffset
protected float parseOffset() throws ParseException, java.io.IOExceptionParses an offset value.- Throws:
ParseExceptionjava.io.IOException
-
parseDigits
protected int parseDigits() throws ParseException, java.io.IOExceptionParses a sequence of digits and returns the integer.- Throws:
ParseExceptionjava.io.IOException
-
parseFraction
protected float parseFraction() throws ParseException, java.io.IOExceptionParses a '.' and a sequence of digits and returns the float.- Throws:
ParseExceptionjava.io.IOException
-
parseUnit
protected float parseUnit() throws ParseException, java.io.IOExceptionParses a time unit and returns the float for the multiplier.- Throws:
ParseExceptionjava.io.IOException
-
parseWallclockValue
protected java.util.Calendar parseWallclockValue() throws ParseException, java.io.IOExceptionParses a wallclock value and returns it as aCalendar.- Throws:
ParseExceptionjava.io.IOException
-
-