gov.nasa.pds.tools.label.parser
Class DefaultLabelParser

java.lang.Object
  extended by gov.nasa.pds.tools.label.parser.DefaultLabelParser
All Implemented Interfaces:
LabelParser, Status

public class DefaultLabelParser
extends java.lang.Object
implements LabelParser, Status

Default implementation

Version:
$Revision: 2652 $
Author:
pramirez

Field Summary
 
Fields inherited from interface gov.nasa.pds.tools.label.validate.Status
FAIL, PASS, UNKNOWN
 
Constructor Summary
DefaultLabelParser()
           
 
Method Summary
 void addIncludePath(java.net.URL includePath)
          Adds an URL where references will be searched for when found in a label.
 void addValidator(LabelValidator validator)
          Adds a LabelValidator that will perform some extravalidation.
 java.lang.String getODLVersion()
          Returns the version of ODL that this parser is compliant with.
 java.lang.String getPDSVersion()
          Returns the version of the PDS specification that this parser is compliant with.
 java.util.Properties getProperties()
          Retrieves parser properties.
static void main(java.lang.String[] args)
           
 Label parse(java.net.URL url)
          Parses the given file
 Label parse(java.net.URL url, Dictionary dictionary)
          Parses the given file and validates against the dictionary.
 Label parse(java.net.URL file, Dictionary dictionary, boolean dataObjectValidation)
          Parses the given file, validates against dictionary, and may perform dataObjectValidation
 Label parsePartial(java.lang.String context, java.net.URL url)
          Parses the given partial label.
 Label parsePartial(java.net.URL url)
          Parses the given partial label.
 Label parsePartial(java.net.URL file, Dictionary dictionary)
          Parses the given partial label and validates against the dictionary.
 Label parsePartial(java.net.URL file, Dictionary dictionary, boolean dataObjectValidation)
          Parses the given partial label, validates against dictionary, and may perform dataObjectValidation
 void setProperties(java.util.Properties properties)
          Passes properties to the parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLabelParser

public DefaultLabelParser()
Method Detail

parse

public Label parse(java.net.URL url)
            throws ParseException,
                   java.io.IOException
Description copied from interface: LabelParser
Parses the given file

Specified by:
parse in interface LabelParser
Parameters:
url - File to
Returns:
Label representation of the file
Throws:
ParseException - - If any syntatic errors are encountered. All errors will be written to the Logger.
java.io.IOException

parse

public Label parse(java.net.URL url,
                   Dictionary dictionary)
            throws ParseException,
                   java.io.IOException
Description copied from interface: LabelParser
Parses the given file and validates against the dictionary.

Specified by:
parse in interface LabelParser
Returns:
Label representation of the file
Throws:
ParseException
java.io.IOException

parse

public Label parse(java.net.URL file,
                   Dictionary dictionary,
                   boolean dataObjectValidation)
            throws ParseException,
                   java.io.IOException
Description copied from interface: LabelParser
Parses the given file, validates against dictionary, and may perform dataObjectValidation

Specified by:
parse in interface LabelParser
Returns:
Label representation of the file
Throws:
ParseException
java.io.IOException

setProperties

public void setProperties(java.util.Properties properties)
Description copied from interface: LabelParser
Passes properties to the parser.

Specified by:
setProperties in interface LabelParser
Parameters:
properties - Set of properties.

getProperties

public java.util.Properties getProperties()
Description copied from interface: LabelParser
Retrieves parser properties.

Specified by:
getProperties in interface LabelParser
Returns:
parser properties

getPDSVersion

public java.lang.String getPDSVersion()
Description copied from interface: LabelParser
Returns the version of the PDS specification that this parser is compliant with.

Specified by:
getPDSVersion in interface LabelParser
Returns:
The PDS version string

getODLVersion

public java.lang.String getODLVersion()
Description copied from interface: LabelParser
Returns the version of ODL that this parser is compliant with.

Specified by:
getODLVersion in interface LabelParser
Returns:
The ODL version string

parsePartial

public Label parsePartial(java.net.URL url)
                   throws ParseException,
                          java.io.IOException
Description copied from interface: LabelParser
Parses the given partial label.

Specified by:
parsePartial in interface LabelParser
Returns:
Label representation of the file
Throws:
ParseException
java.io.IOException

parsePartial

public Label parsePartial(java.lang.String context,
                          java.net.URL url)
                   throws ParseException,
                          java.io.IOException
Description copied from interface: LabelParser
Parses the given partial label.

Specified by:
parsePartial in interface LabelParser
Returns:
Label representation of the file
Throws:
ParseException
java.io.IOException
See Also:
LabelParser.parsePartial(String,java.net.URL)

parsePartial

public Label parsePartial(java.net.URL file,
                          Dictionary dictionary)
                   throws ParseException,
                          java.io.IOException
Description copied from interface: LabelParser
Parses the given partial label and validates against the dictionary.

Specified by:
parsePartial in interface LabelParser
Returns:
Label representation of the file
Throws:
ParseException
java.io.IOException

parsePartial

public Label parsePartial(java.net.URL file,
                          Dictionary dictionary,
                          boolean dataObjectValidation)
                   throws ParseException,
                          java.io.IOException
Description copied from interface: LabelParser
Parses the given partial label, validates against dictionary, and may perform dataObjectValidation

Specified by:
parsePartial in interface LabelParser
Returns:
Label representation of the file
Throws:
ParseException
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Parameters:
args -
Throws:
java.lang.Exception

addIncludePath

public void addIncludePath(java.net.URL includePath)
Description copied from interface: LabelParser
Adds an URL where references will be searched for when found in a label.

Specified by:
addIncludePath in interface LabelParser
Parameters:
includePath - points to a directory that will be searched.

addValidator

public void addValidator(LabelValidator validator)
Description copied from interface: LabelParser
Adds a LabelValidator that will perform some extravalidation.

Specified by:
addValidator in interface LabelParser
Parameters:
validator - which will be run as a step in the validation pipeline


Copyright © 2005-2007 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.