Package cds.savot.pull
Class SavotPullParser
java.lang.Object
cds.savot.pull.SavotPullParser
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
- Author:
- Andre Schaaff
-
Constructor Summary
ConstructorsConstructorDescriptionSavotPullParser
(InputStream instream, int mode, String enc) ConstructorSavotPullParser
(InputStream instream, int mode, String enc, boolean debug) ConstructorSavotPullParser
(Reader reader, int mode) ConstructorSavotPullParser
(Reader reader, int mode, boolean debug) ConstructorSavotPullParser
(String file, int mode) ConstructorSavotPullParser
(String file, int mode, boolean debug) ConstructorSavotPullParser
(URL url, int mode, String enc) ConstructorSavotPullParser
(URL url, int mode, String enc, boolean debug) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the input stream if still openedvoid
enableDebug
(boolean debug) Enable debug modeGet all resourcesgetCoosysFromRef
(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 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 (sequential mode only)Get the next Resource (sequential mode only)getParamFromRef
(String ref) Search a PARAM 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 refReturns the statsint
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 Parser VersionGet a reference to V0TABLE objectstatic void
Mainvoid
For test only
-
Constructor Details
-
SavotPullParser
Constructor- Parameters:
file
- a file to parsemode
- FULL or RESOURCEREAD/ROWREAD (for small memory size applications)
-
SavotPullParser
Constructor- Parameters:
file
- a file to parsemode
- FULL or RESOURCEREAD/ROWREAD (for small memory size applications)debug
-
-
SavotPullParser
Constructor- Parameters:
url
- url to parsemode
- FULL or RESOURCEREAD/ROWREAD (for small memory size applications)enc
- encoding (example : UTF-8)
-
SavotPullParser
Constructor- Parameters:
url
- url to parsemode
- FULL or RESOURCEREAD/ROWREAD (for small memory size applications)enc
- encoding (example : UTF-8)debug
-
-
SavotPullParser
Constructor- Parameters:
instream
- stream to parsemode
- FULL or RESOURCEREAD/ROWREAD (for small memory size applications)enc
- encoding (example : UTF-8)
-
SavotPullParser
Constructor- Parameters:
instream
- stream to parsemode
- FULL or RESOURCEREAD/ROWREAD (for small memory size applications)enc
- encoding (example : UTF-8)debug
-
-
SavotPullParser
Constructor- Parameters:
reader
- reader to parsemode
- FULL or RESOURCEREAD/ROWREAD (for small memory size applications)
-
SavotPullParser
Constructor- Parameters:
reader
- reader to parsemode
- FULL or RESOURCEREAD/ROWREAD (for small memory size applications)debug
-
-
-
Method Details
-
close
public void close()Close the input stream if still opened -
getStatistics
Returns the stats- Returns:
- statistics
-
getNextResource
Get the next Resource (sequential mode only)- Returns:
- a SavotResource
-
getNextTR
Get the next Resource (sequential mode only)- Returns:
- a SavotResource
-
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:
- an int value
-
getTableCount
public int getTableCount()Get the number of TABLE elements in the document (for statistics)- Returns:
- an int value
-
getTRCount
public int getTRCount()Get the number of TR elements in the document (for statistics)- Returns:
- an int value
-
getDataCount
public int getDataCount()Get the number of DATA elements in the document (for statistics)- Returns:
- an int 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
-
getParamFromRef
Search a PARAM corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotParam
-
getTableFromRef
Search a TABLE corresponding to an ID ref- Parameters:
ref
-- Returns:
- SavotTable
-
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 all resources- Returns:
- SavotVOTable
-
getVersion
Get Parser Version- Returns:
- String
-
enableDebug
public void enableDebug(boolean debug) Enable debug mode- Parameters:
debug
- boolean
-
sequentialTester
public void sequentialTester()For test only -
main
Main- Parameters:
argv
-- Throws:
IOException
-