Package cds.savot.pull
Class SavotPullEngine
java.lang.Object
cds.savot.pull.SavotPullEngine
- All Implemented Interfaces:
Markups
It has been tested with kXML Pull parser implementation
but it is possible to use other pull parsers
Designed to use with Pull parsers complient with Standard Pull Implementation v1
LBO: Note: equalsIgnoreCase() vs() equals as XML is case sensitive and VOTable specification says that clearly- Author:
- Andre Schaaff
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
default stack capacity = 4 slotsstatic final int
FULL parsing mode: deprecated and replaced by FULLREADstatic final int
FULLREAD parsing mode all in memorystatic final int
RESOURCEREAD parsing mode: row per row readingstatic final int
ROWREAD parsing mode: row per row readingstatic final int
SEQUENTIAL parsing mode: deprecated and replaced by RESOURCEREADFields inherited from interface cds.savot.common.Markups
ACTION, ACTUATE, ARRAYSIZE, BINARY, CONTENTROLE, CONTENTTYPE, COOSYS, DATA, DATATYPE, DEFINITIONS, DESCRIPTION, ENCODING, EPOCH, EQUINOX, EXPIRES, EXTNUM, FIELD, FIELDREF, FITS, GREF, GROUP, HREF, ID, INCLUSIVE, INFO, INVALID, LINK, MAX, MIN, NAME, NROWS, NULL, OPTION, PARAM, PARAMREF, PRECISION, REF, RESOURCE, RIGHTS, SAVOTPARSER, STREAM, SYSTEM, SYSTEM_ATTRIBUTE, TABLE, TABLEDATA, TD, TITLE, TR, TYPE, UCD, UNIT, UTYPE, VALUE, VALUES, VERSION, VOTABLE, WIDTH, XML, XMLNS, XMLNSXSI, XSI, XSI_NOSCHEMA, XSI_SCHEMA, XSINOSCHEMA, XSISCHEMA, XTYPE
-
Constructor Summary
ConstructorsConstructorDescriptionSavotPullEngine
(org.xmlpull.v1.XmlPullParser parser, InputStream instream, int mode, String enc, boolean debug, SavotStatistics stats) ConstructorSavotPullEngine
(org.xmlpull.v1.XmlPullParser parser, Reader reader, int mode, boolean debug, SavotStatistics stats) ConstructorSavotPullEngine
(org.xmlpull.v1.XmlPullParser parser, String file, int mode, boolean debug, SavotStatistics stats) ConstructorSavotPullEngine
(org.xmlpull.v1.XmlPullParser parser, URL url, int mode, String enc, boolean debug, SavotStatistics stats) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the input stream if still opened and free the internal parservoid
enableDebug
(boolean debug) Enable debug modeGet current VOTable (all resources)getCoosysFromRef
(String ref) Search a COOSYS corresponding to an ID refint
Get the number of DATA elements in the document (for statistics)getFieldFromRef
(String ref) Search a FIELD corresponding to an ID refgetFieldRefFromRef
(String ref) Search a FIELDref corresponding to an ID refgetGroupFromRef
(String ref) Search a GROUP corresponding to an ID refGet a reference on the Hashtable containing the link between ID and refgetInfoFromRef
(String ref) Search a RESOURCE corresponding to an ID refgetLinkFromRef
(String ref) Search a LINK corresponding to an ID refGet the next Resource (warning : RESOURCEREAD mode only)Get the next TR (warning : ROWREAD mode only)getParamFromRef
(String ref) Search a PARAM corresponding to an ID refgetParamRefFromRef
(String ref) Search a PARAMref corresponding to an ID refint
Get the number of RESOURCE elements in the document (for statistics)getResourceFromRef
(String ref) Search a RESOURCE corresponding to an ID refint
Get the number of TABLE elements in the document (for statistics)getTableFromRef
(String ref) Search a TABLE corresponding to an ID refint
Get the number of TR elements in the document (for statistics)getValuesFromRef
(String ref) Search a VALUES corresponding to an ID refGet a reference to V0TABLE objectvoid
parse
(int parsingType) Parsing enginevoid
reset()
Reset of the engine before another parsing LBO: useless methods ?
-
Field Details
-
FULL
public static final int FULLFULL parsing mode: deprecated and replaced by FULLREAD- See Also:
-
FULLREAD
public static final int FULLREADFULLREAD parsing mode all in memory- See Also:
-
SEQUENTIAL
public static final int SEQUENTIALSEQUENTIAL parsing mode: deprecated and replaced by RESOURCEREAD- See Also:
-
RESOURCEREAD
public static final int RESOURCEREADRESOURCEREAD parsing mode: row per row reading- See Also:
-
ROWREAD
public static final int ROWREADROWREAD parsing mode: row per row reading- See Also:
-
DEFAULT_STACK_CAPACITY
public static final int DEFAULT_STACK_CAPACITYdefault stack capacity = 4 slots- See Also:
-
-
Constructor Details
-
SavotPullEngine
public SavotPullEngine(org.xmlpull.v1.XmlPullParser parser, String file, int mode, boolean debug, SavotStatistics stats) Constructor- Parameters:
parser
-file
- a file to parsemode
- FULLREAD (all in memory), RESOURCEREAD (per RESOURCE) or ROWREAD (per ROW, for small memory size applications)debug
-stats
-
-
SavotPullEngine
public SavotPullEngine(org.xmlpull.v1.XmlPullParser parser, URL url, int mode, String enc, boolean debug, SavotStatistics stats) Constructor- Parameters:
parser
-url
- url to parsemode
- FULLREAD (all in memory), RESOURCEREAD (per RESOURCE) or ROWREAD (per ROW, for small memory size applications)enc
- encoding (example : UTF-8)debug
-stats
-
-
SavotPullEngine
public SavotPullEngine(org.xmlpull.v1.XmlPullParser parser, InputStream instream, int mode, String enc, boolean debug, SavotStatistics stats) Constructor- Parameters:
parser
-instream
- stream to parsemode
- FULL (all in memory), RESOURCEREAD (per RESOURCE) or ROWREAD (per TR for small memory size applications)enc
- encoding (example : UTF-8)debug
-stats
-
-
SavotPullEngine
public SavotPullEngine(org.xmlpull.v1.XmlPullParser parser, Reader reader, int mode, boolean debug, SavotStatistics stats) Constructor- Parameters:
parser
-reader
- reader to parsemode
- FULL (all in memory), RESOURCEREAD (per RESOURCE) or ROWREAD (per TR for small memory size applications)debug
-stats
-
-
-
Method Details
-
close
public void close()Close the input stream if still opened and free the internal parser -
reset
public void reset()Reset of the engine before another parsing LBO: useless methods ? -
parse
Parsing engine- Parameters:
parsingType
- FULLREAD (all in memory), RESOURCEREAD (per RESOURCE) or ROWREAD (per ROW, for small memory size applications)- Throws:
IOException
Exception
-
getNextResource
Get the next Resource (warning : RESOURCEREAD mode only)- Returns:
- a SavotResource (always NULL if other mode)
-
getNextTR
Get the next TR (warning : ROWREAD mode only)- Returns:
- a SavotTR (always NULL if other mode)
-
getVOTable
Get a reference to V0TABLE object- Returns:
- SavotVOTable
-
getResourceCount
public int getResourceCount()Get the number of RESOURCE elements in the document (for statistics)- Returns:
- a long value
-
getTableCount
public int getTableCount()Get the number of TABLE elements in the document (for statistics)- Returns:
- a long value
-
getTRCount
public int getTRCount()Get the number of TR elements in the document (for statistics)- Returns:
- a long value
-
getDataCount
public int getDataCount()Get the number of DATA elements in the document (for statistics)- Returns:
- a long value
-
getIdRefLinks
Get a reference on the Hashtable containing the link between ID and ref- Returns:
- a refernce to the Hashtable
-
getResourceFromRef
Search a RESOURCE corresponding to an ID ref- Parameters:
ref
-- Returns:
- a reference to a SavotResource object
-
getFieldFromRef
Search a FIELD corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotField
-
getFieldRefFromRef
Search a FIELDref corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotFieldRef
-
getParamFromRef
Search a PARAM corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotParam
-
getParamRefFromRef
Search a PARAMref corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotParamRef
-
getTableFromRef
Search a TABLE corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotTable
-
getGroupFromRef
Search a GROUP corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotGROUP
-
getInfoFromRef
Search a RESOURCE corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotInfo
-
getValuesFromRef
Search a VALUES corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotValues
-
getLinkFromRef
Search a LINK corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotLink
-
getCoosysFromRef
Search a COOSYS corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotCoosys
-
getAllResources
Get current VOTable (all resources)- Returns:
- SavotVOTable
-
enableDebug
public void enableDebug(boolean debug) Enable debug mode- Parameters:
debug
- boolean
-