gov.nasa.pds.tools.label
Class Label

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

public class Label
extends Object

This class represents a PDS label.

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

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

Constructor Detail

Label

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


Label

public Label(File labelFile)
Method Detail

setCaptureProblems

public void setCaptureProblems(boolean captureProblems)

getCaptureProblems

public boolean getCaptureProblems()

setAllowExternalProblems

public void setAllowExternalProblems(boolean allowExternalProblems)

getAllowExternalProblems

public boolean getAllowExternalProblems()

setHasBlankFill

public void setHasBlankFill(boolean hasBlankFill)

isValid

public boolean isValid()

setInvalid

public void setInvalid()

setAttachedStartByte

public void setAttachedStartByte(Integer startByte)

getAttachedStartByte

public long getAttachedStartByte()

hasAttachedContent

public boolean hasAttachedContent()

getLabelPath

public String getLabelPath()

addProblem

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

addProblem

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

addProblem

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

addProblem

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

addProblem

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

addProblem

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

addProblem

public void addProblem(LabelParserException e)

addProblem

public void addProblem(URI sourceURI,
                       LabelParserException e)

addProblem

public void addProblem(File sourceFile,
                       LabelParserException e)

addProblem

public void addProblem(Statement statement,
                       LabelParserException e)

getStatement

public 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(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 List<GroupStatement> getGroups(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 List<ObjectStatement> getObjects(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 List<Statement> getStatements()
Retrieves the statements associated with this label

Returns:
List of Statement

getObjects

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

Returns:
List of ObjectStatement

getGroups

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

Returns:
list of GroupStatement

getAttributes

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

Returns:
list of AttributeStatement

getPointers

public 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 List<LabelParserException> getProblems()

addAncestor

public void addAncestor(String path)

addAncestors

public void addAncestors(List<String> pointers)

hasAncestor

public boolean hasAncestor(URI pointer)

hasAncestor

public boolean hasAncestor(File pointer)

hasIncludePointer

public boolean hasIncludePointer(String path)

getAncestors

public List<String> getAncestors()

getLabelURI

public URI getLabelURI()

getLabelFile

public File getLabelFile()

getSourceString

public String getSourceString()

getSourceNameString

public 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 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 String toString()
Overrides:
toString in class Object


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