Package gov.nasa.pds.tools.label
Class Label
- java.lang.Object
-
- gov.nasa.pds.tools.label.Label
-
public class Label extends Object
This class represents a PDS label.- Version:
- $Revision$
- Author:
- pramirez, jagander
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Label.LineLength
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(int lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
void
addProblem(int lineNumber, String key, Constants.ProblemType type, Object... arguments)
void
addProblem(Statement statement, LabelParserException e)
void
addProblem(Statement statement, Integer column, String key, Constants.ProblemType type, Object... arguments)
void
addProblem(Statement statement, String key, Constants.ProblemType type, Object... arguments)
void
addProblem(LabelParserException e)
void
addProblem(File sourceFile, int lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)
void
addProblem(File sourceFile, LabelParserException e)
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 labelvoid
checkLineLengths()
boolean
getAllowExternalProblems()
List<String>
getAncestors()
long
getAttachedStartByte()
AttributeStatement
getAttribute(String identifier)
Retrieves the attribute with the identifier or null if not foundList<AttributeStatement>
getAttributes()
Retrieves attributes associated with this labelboolean
getCaptureProblems()
List<GroupStatement>
getGroups()
Retrieves groups associated with this labelList<GroupStatement>
getGroups(String identifier)
Retrieves the groups with the identifier or null if not foundFile
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 labelList<ObjectStatement>
getObjects(String identifier)
Retrieves the object with the identifier or null if not foundList<PointerStatement>
getPointers()
Retrieves pointers associated with this labelList<LabelParserException>
getProblems()
static long
getSkipBytes(Label label, Numeric startPosition)
String
getSourceNameString()
String
getSourceString()
List<Statement>
getStatement(DictIdentifier identifier)
Retrieves a statement with the identifierList<Statement>
getStatements()
Retrieves the statements associated with this labelboolean
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()
-
-
-
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
ofGroupStatement
-
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
ofObjectStatement
-
getStatements
public List<Statement> getStatements()
Retrieves the statements associated with this label
-
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)
-
hasAncestor
public boolean hasAncestor(URI pointer)
-
hasAncestor
public boolean hasAncestor(File pointer)
-
hasIncludePointer
public boolean hasIncludePointer(String path)
-
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 theline terminator. - Parameters:
line
- the line number for which we found a lengthlength
- 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()
-
setHasEndStatement
public void setHasEndStatement()
-
hasEndStatement
public boolean hasEndStatement()
-
-