cds.savot.pull
Class SavotPullEngine

java.lang.Object
  extended by cds.savot.pull.SavotPullEngine
All Implemented Interfaces:
Markups

public class SavotPullEngine
extends java.lang.Object
implements 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

Version:
2.6 Copyright CDS 2002-2005 (kickoff 31 May 02)
Author:
Andre Schaaff

Field Summary
static int FULL
           
 java.util.Hashtable idRefLinks
          Hashtable containing object references which have an ID So it is possible to retrieve such object reference Used to resolve ID ref
static int SEQUENTIAL
           
 
Fields 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, TABLE, TABLEDATA, TD, TITLE, TR, TYPE, UCD, UNIT, UTYPE, VALUE, VALUES, VERSION, VOTABLE, WIDTH, XMLNS, XMLNSXSI, XSINOSCHEMA, XSISCHEMA
 
Constructor Summary
SavotPullEngine(XmlPullParser parser, java.io.InputStream instream, int mode, java.lang.String enc, boolean debug)
          Constructor
SavotPullEngine(XmlPullParser parser, java.lang.String file, int mode, boolean debug)
          Constructor
SavotPullEngine(XmlPullParser parser, java.net.URL url, int mode, java.lang.String enc, boolean debug)
          Constructor
 
Method Summary
 void enableDebug(boolean debug)
          Enable debug mode
 SavotVOTable getAllResources()
          Get current VOTable (all resources)
 SavotCoosys getCoosysFromRef(java.lang.String ref)
          Search a COOSYS corresponding to an ID ref
 long getDataCount()
          Get the number of DATA elements in the document (for statistics)
 SavotField getFieldFromRef(java.lang.String ref)
          Search a FIELD corresponding to an ID ref
 SavotFieldRef getFieldRefFromRef(java.lang.String ref)
          Search a FIELDref corresponding to an ID ref
 SavotGroup getGroupFromRef(java.lang.String ref)
          Search a GROUP corresponding to an ID ref
 java.util.Hashtable getIdRefLinks()
          Get a reference on the Hashtable containing the link between ID and ref
 SavotInfo getInfoFromRef(java.lang.String ref)
          Search a RESOURCE corresponding to an ID ref
 SavotLink getLinkFromRef(java.lang.String ref)
          Search a LINK corresponding to an ID ref
 SavotResource getNextResource()
          Get the next Resource (warning : SEQUENTIAL mode only)
 SavotParam getParamFromRef(java.lang.String ref)
          Search a PARAM corresponding to an ID ref
 SavotParamRef getParamRefFromRef(java.lang.String ref)
          Search a PARAMref corresponding to an ID ref
 long getResourceCount()
          Get the number of RESOURCE elements in the document (for statistics)
 SavotResource getResourceFromRef(java.lang.String ref)
          Search a RESOURCE corresponding to an ID ref
 long getTableCount()
          Get the number of TABLE elements in the document (for statistics)
 SavotTable getTableFromRef(java.lang.String ref)
          Search a TABLE corresponding to an ID ref
 long getTRCount()
          Get the number of TR elements in the document (for statistics)
 SavotValues getValuesFromRef(java.lang.String ref)
          Search a VALUES corresponding to an ID ref
 SavotVOTable getVOTable()
          Get a reference to V0TABLE object
 SavotResource parse(XmlPullParser parser, int parsingType)
          Parsing engine
 void reset()
          Reset of the engine before another parsing
 void sequentialTester()
          For test only
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FULL

public static int FULL

SEQUENTIAL

public static int SEQUENTIAL

idRefLinks

public java.util.Hashtable idRefLinks
Hashtable containing object references which have an ID So it is possible to retrieve such object reference Used to resolve ID ref

Constructor Detail

SavotPullEngine

public SavotPullEngine(XmlPullParser parser,
                       java.lang.String file,
                       int mode,
                       boolean debug)
Constructor

Parameters:
parser -
file - a file to parse
mode - FULL or SEQUENTIAL (for small memory size applications)

SavotPullEngine

public SavotPullEngine(XmlPullParser parser,
                       java.net.URL url,
                       int mode,
                       java.lang.String enc,
                       boolean debug)
Constructor

Parameters:
parser -
url - url to parse
mode - FULL or SEQUENTIAL (for small memory size applications)
enc - encoding (example : UTF-8)

SavotPullEngine

public SavotPullEngine(XmlPullParser parser,
                       java.io.InputStream instream,
                       int mode,
                       java.lang.String enc,
                       boolean debug)
Constructor

Parameters:
parser -
instream - stream to parse
mode - FULL or SEQUENTIAL (for small memory size applications)
enc - encoding (example : UTF-8)
Method Detail

reset

public void reset()
Reset of the engine before another parsing


parse

public SavotResource parse(XmlPullParser parser,
                           int parsingType)
                    throws java.io.IOException
Parsing engine

Parameters:
parser - an XML pull parser (example : kXML)
parsingType - mode FULL or SEQUENTIAL
Returns:
SavotResource
Throws:
java.io.IOException

getNextResource

public SavotResource getNextResource()
Get the next Resource (warning : SEQUENTIAL mode only)

Returns:
a SavotResource (always NULL if FULL mode)

getVOTable

public SavotVOTable getVOTable()
Get a reference to V0TABLE object

Returns:
SavotVOTable

sequentialTester

public void sequentialTester()
For test only


getResourceCount

public long getResourceCount()
Get the number of RESOURCE elements in the document (for statistics)

Returns:
a long value

getTableCount

public long getTableCount()
Get the number of TABLE elements in the document (for statistics)

Returns:
a long value

getTRCount

public long getTRCount()
Get the number of TR elements in the document (for statistics)

Returns:
a long value

getDataCount

public long getDataCount()
Get the number of DATA elements in the document (for statistics)

Returns:
a long value

getIdRefLinks

public java.util.Hashtable getIdRefLinks()
Get a reference on the Hashtable containing the link between ID and ref

Returns:
a refernce to the Hashtable

getResourceFromRef

public SavotResource getResourceFromRef(java.lang.String ref)
Search a RESOURCE corresponding to an ID ref

Parameters:
ref -
Returns:
a reference to a SavotResource object

getFieldFromRef

public SavotField getFieldFromRef(java.lang.String ref)
Search a FIELD corresponding to an ID ref

Parameters:
ref -
Returns:
SavotField

getFieldRefFromRef

public SavotFieldRef getFieldRefFromRef(java.lang.String ref)
Search a FIELDref corresponding to an ID ref

Parameters:
ref -
Returns:
SavotFieldRef

getParamFromRef

public SavotParam getParamFromRef(java.lang.String ref)
Search a PARAM corresponding to an ID ref

Parameters:
ref -
Returns:
SavotParam

getParamRefFromRef

public SavotParamRef getParamRefFromRef(java.lang.String ref)
Search a PARAMref corresponding to an ID ref

Parameters:
ref -
Returns:
SavotParamRef

getTableFromRef

public SavotTable getTableFromRef(java.lang.String ref)
Search a TABLE corresponding to an ID ref

Parameters:
ref -
Returns:
SavotTable

getGroupFromRef

public SavotGroup getGroupFromRef(java.lang.String ref)
Search a GROUP corresponding to an ID ref

Parameters:
ref -
Returns:
SavotGROUP

getInfoFromRef

public SavotInfo getInfoFromRef(java.lang.String ref)
Search a RESOURCE corresponding to an ID ref

Parameters:
ref -
Returns:
SavotInfo

getValuesFromRef

public SavotValues getValuesFromRef(java.lang.String ref)
Search a VALUES corresponding to an ID ref

Parameters:
ref -
Returns:
SavotValues

getLinkFromRef

public SavotLink getLinkFromRef(java.lang.String ref)
Search a LINK corresponding to an ID ref

Parameters:
ref -
Returns:
SavotLink

getCoosysFromRef

public SavotCoosys getCoosysFromRef(java.lang.String ref)
Search a COOSYS corresponding to an ID ref

Parameters:
ref -
Returns:
SavotCoosys

getAllResources

public SavotVOTable getAllResources()
Get current VOTable (all resources)

Returns:
SavotVOTable

enableDebug

public void enableDebug(boolean debug)
Enable debug mode

Parameters:
debug - boolean


Copyright © 2009 UDS/CNRS