its.backbone.sdd
Class Parser

java.lang.Object
  extended byits.backbone.sdd.Parser

public class Parser
extends java.lang.Object

Used by the SDD Receiver to validate incoming SDD Schema and Contents frames, and convert them into Schema and Contents objects. Also invoked by the Schema and Contents objects' constructors when a string is used to initialize them.


Constructor Summary
Parser()
           
 
Method Summary
 Contents parseContents(byte[] rgb)
          Converts argument to string.
 Contents parseContents(Schema schema, java.lang.String strContents)
          Invokes the SDD Contents parser on the given text.
 Contents parseContents(java.lang.String strContents)
          Invokes the SDD Contents parser on the given text.
 ContentsData parseContentsData(java.util.Vector columns, java.lang.String rowset, boolean preserveQuotes)
          Creates a ContentsData object from data in a text buffer.
 Schema parseSchema(byte[] schemabuf)
          Converts argument to string.
 Schema parseSchema(java.lang.String strSchema)
          Invokes the SDD Schema parser on the given text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()
Method Detail

parseContents

public Contents parseContents(java.lang.String strContents)
                       throws ContentsParserException,
                              java.lang.Exception
Invokes the SDD Contents parser on the given text. Uses the SDD Schema previously parsed by the parseSchema method to validate the tables and entries in the contents file.

Throws:
ContentsParserException - if a error was found in syntax or semantics
java.lang.Exception

parseContents

public Contents parseContents(Schema schema,
                              java.lang.String strContents)
                       throws ContentsParserException,
                              java.lang.Exception
Invokes the SDD Contents parser on the given text. Uses the given SDD Schema object to validate the tables and entries in the contents file.

Throws:
ContentsParserException - if a error was found in syntax or semantics
java.lang.Exception

parseSchema

public Schema parseSchema(java.lang.String strSchema)
                   throws SchemaParserException,
                          java.lang.Exception
Invokes the SDD Schema parser on the given text.

Throws:
SchemaParserException - if a error was found in syntax or semantics
java.lang.Exception

parseContentsData

public ContentsData parseContentsData(java.util.Vector columns,
                                      java.lang.String rowset,
                                      boolean preserveQuotes)
Creates a ContentsData object from data in a text buffer. The elements in each row are comma-separated, and the rows are semicolon-separated. Assumes that the given data has been extracted from the contents frame by the SDD Contents parser, and therefore all necessary type checking has already been done. You may wonder why the Contents parser doesn't create the ContentsData objects itself. It's because the major performance hit is in allocating strings for each element, and thus we want to delay that work as long as we can. By creating the ContentsData object only when the user calls readTable, we gain the ability to have huge tables in the Contents frame that never get turned into ContentsData objects, and therefore don't impact performance very much.


parseContents

public Contents parseContents(byte[] rgb)
                       throws ContentsParserException,
                              java.lang.Exception
Converts argument to string.

Throws:
ContentsParserException
java.lang.Exception

parseSchema

public Schema parseSchema(byte[] schemabuf)
                   throws SchemaParserException,
                          java.lang.Exception
Converts argument to string.

Throws:
SchemaParserException
java.lang.Exception