gov.nasa.pds.tools.label
Class Label

java.lang.Object
  extended by gov.nasa.pds.tools.label.Label

public class Label
extends java.lang.Object

This class represents a PDS label.

Version:
$Revision: 4967 $
Author:
pramirez, jagander

Nested Class Summary
static class Label.LineLength
           
 
Constructor Summary
Label(java.io.File labelFile)
           
Label(java.net.URI labelURI)
          Constructs an object representation of a PDS label.
 
Method Summary
 void addIncludePointer(java.io.File pointer)
           
 void addIncludePointer(java.net.URI pointer)
           
 void addIncludePointers(java.util.List<java.lang.String> pointers)
           
 void addLineLength(int line, int length)
          Remember a line length for a line within a label.
 void addProblem(java.io.File sourceFile, int lineNumber, java.lang.Integer column, java.lang.String key, Constants.ProblemType type, java.lang.Object... arguments)
           
 void addProblem(java.io.File sourceFile, LabelParserException e)
           
 void addProblem(int lineNumber, java.lang.Integer column, java.lang.String key, Constants.ProblemType type, java.lang.Object... arguments)
           
 void addProblem(int lineNumber, java.lang.String key, Constants.ProblemType type, java.lang.Object... arguments)
           
 void addProblem(LabelParserException e)
           
 void addProblem(Statement statement, java.lang.Integer column, java.lang.String key, Constants.ProblemType type, java.lang.Object... arguments)
           
 void addProblem(Statement statement, LabelParserException e)
           
 void addProblem(Statement statement, java.lang.String key, Constants.ProblemType type, java.lang.Object... arguments)
           
 void addProblem(java.net.URI sourceURI, int lineNumber, java.lang.Integer column, java.lang.String key, Constants.ProblemType type, java.lang.Object... arguments)
           
 void addProblem(java.net.URI sourceURI, LabelParserException e)
           
 void addStatement(Statement statement)
          Associates a statement with this label
 void checkLineLengths()
           
 long getAttachedStartByte()
           
 AttributeStatement getAttribute(java.lang.String identifier)
          Retrieves the attribute with the identifier or null if not found
 java.util.List<AttributeStatement> getAttributes()
          Retrieves attributes associated with this label
 java.util.List<GroupStatement> getGroups()
          Retrieves groups associated with this label
 java.util.List<GroupStatement> getGroups(java.lang.String identifier)
          Retrieves the groups with the identifier or null if not found
 java.util.List<java.lang.String> getIncludePointers()
           
 java.io.File getLabelFile()
           
 java.net.URI getLabelURI()
           
 java.util.List<Label.LineLength> getLineLengths()
          Return the line lengths for all label lines.
 java.util.List<ObjectStatement> getObjects()
          Retrieves objects associated with this label
 java.util.List<ObjectStatement> getObjects(java.lang.String identifier)
          Retrieves the object with the identifier or null if not found
 java.util.List<PointerStatement> getPointers()
          Retrieves pointers associated with this label
 java.util.List<LabelParserException> getProblems()
           
static long getSkipBytes(Label label, Numeric startPosition)
           
 java.lang.String getSourceNameString()
           
 java.lang.String getSourceString()
           
 java.util.List<Statement> getStatement(DictIdentifier identifier)
          Retrieves a statement with the identifier
 java.util.List<Statement> getStatements()
          Retrieves the statements associated with this label
 boolean hasAttachedContent()
           
 boolean hasEndStatement()
           
 boolean hasIncludePointer(java.io.File pointer)
           
 boolean hasIncludePointer(java.lang.String path)
           
 boolean hasIncludePointer(java.net.URI pointer)
           
 boolean isValid()
           
 void setAttachedStartByte(java.lang.Integer startByte)
           
 void setCaptureProblems(boolean captureProblems)
           
 void setHasBlankFill(boolean hasBlankFill)
           
 void setHasEndStatement()
           
 void setInvalid()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Label

public Label(java.net.URI labelURI)
Constructs an object representation of a PDS label.


Label

public Label(java.io.File labelFile)
Method Detail

setCaptureProblems

public void setCaptureProblems(boolean captureProblems)

setHasBlankFill

public void setHasBlankFill(boolean hasBlankFill)

isValid

public boolean isValid()

setInvalid

public void setInvalid()

setAttachedStartByte

public void setAttachedStartByte(java.lang.Integer startByte)

getAttachedStartByte

public long getAttachedStartByte()

hasAttachedContent

public boolean hasAttachedContent()

addProblem

public void addProblem(int lineNumber,
                       java.lang.String key,
                       Constants.ProblemType type,
                       java.lang.Object... arguments)

addProblem

public void addProblem(int lineNumber,
                       java.lang.Integer column,
                       java.lang.String key,
                       Constants.ProblemType type,
                       java.lang.Object... arguments)

addProblem

public void addProblem(Statement statement,
                       java.lang.String key,
                       Constants.ProblemType type,
                       java.lang.Object... arguments)

addProblem

public void addProblem(Statement statement,
                       java.lang.Integer column,
                       java.lang.String key,
                       Constants.ProblemType type,
                       java.lang.Object... arguments)

addProblem

public void addProblem(java.net.URI sourceURI,
                       int lineNumber,
                       java.lang.Integer column,
                       java.lang.String key,
                       Constants.ProblemType type,
                       java.lang.Object... arguments)

addProblem

public void addProblem(java.io.File sourceFile,
                       int lineNumber,
                       java.lang.Integer column,
                       java.lang.String key,
                       Constants.ProblemType type,
                       java.lang.Object... arguments)

addProblem

public void addProblem(LabelParserException e)

addProblem

public void addProblem(java.net.URI sourceURI,
                       LabelParserException e)

addProblem

public void addProblem(java.io.File sourceFile,
                       LabelParserException e)

addProblem

public void addProblem(Statement statement,
                       LabelParserException e)

getStatement

public java.util.List<Statement> getStatement(DictIdentifier identifier)
Retrieves a statement with the identifier

Parameters:
identifier - Identifies the statement(s) to retrieve
Returns:
The named statement or null if not found

getAttribute

public AttributeStatement getAttribute(java.lang.String identifier)
Retrieves the attribute with the identifier or null if not found

Parameters:
identifier - of attribute to find
Returns:
attribute or null

getGroups

public java.util.List<GroupStatement> getGroups(java.lang.String identifier)
Retrieves the groups with the identifier or null if not found

Parameters:
identifier - of group to find
Returns:
List of GroupStatement

getObjects

public java.util.List<ObjectStatement> getObjects(java.lang.String identifier)
Retrieves the object with the identifier or null if not found

Parameters:
identifier - of object to find
Returns:
List of ObjectStatement

getStatements

public java.util.List<Statement> getStatements()
Retrieves the statements associated with this label

Returns:
List of Statement

getObjects

public java.util.List<ObjectStatement> getObjects()
Retrieves objects associated with this label

Returns:
List of ObjectStatement

getGroups

public java.util.List<GroupStatement> getGroups()
Retrieves groups associated with this label

Returns:
list of GroupStatement

getAttributes

public java.util.List<AttributeStatement> getAttributes()
Retrieves attributes associated with this label

Returns:
list of AttributeStatement

getPointers

public java.util.List<PointerStatement> getPointers()
Retrieves pointers associated with this label

Returns:
list of PointerStatement

addStatement

public void addStatement(Statement statement)
Associates a statement with this label

Parameters:
statement - to be added to label

getProblems

public java.util.List<LabelParserException> getProblems()

addIncludePointer

public void addIncludePointer(java.io.File pointer)

addIncludePointer

public void addIncludePointer(java.net.URI pointer)

addIncludePointers

public void addIncludePointers(java.util.List<java.lang.String> pointers)

hasIncludePointer

public boolean hasIncludePointer(java.net.URI pointer)

hasIncludePointer

public boolean hasIncludePointer(java.io.File pointer)

hasIncludePointer

public boolean hasIncludePointer(java.lang.String path)

getIncludePointers

public java.util.List<java.lang.String> getIncludePointers()

getLabelURI

public java.net.URI getLabelURI()

getLabelFile

public java.io.File getLabelFile()

getSourceString

public java.lang.String getSourceString()

getSourceNameString

public java.lang.String getSourceNameString()

addLineLength

public void addLineLength(int line,
                          int length)
Remember a line length for a line within a label. The line length includes the line terminator.

Parameters:
line - the line number for which we found a length
length - the line length found

getLineLengths

public java.util.List<Label.LineLength> getLineLengths()
Return the line lengths for all label lines.

Returns:
a list of the line lengths found

checkLineLengths

public void checkLineLengths()

getSkipBytes

public static long getSkipBytes(Label label,
                                Numeric startPosition)

setHasEndStatement

public void setHasEndStatement()

hasEndStatement

public boolean hasEndStatement()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005-2009 Planetary Data System. All Rights Reserved.