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 classLabel.LineLength
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAncestor(String path)voidaddAncestors(List<String> pointers)voidaddLineLength(int line, int length)Remember a line length for a line within a label.voidaddProblem(int lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)voidaddProblem(int lineNumber, String key, Constants.ProblemType type, Object... arguments)voidaddProblem(Statement statement, LabelParserException e)voidaddProblem(Statement statement, Integer column, String key, Constants.ProblemType type, Object... arguments)voidaddProblem(Statement statement, String key, Constants.ProblemType type, Object... arguments)voidaddProblem(LabelParserException e)voidaddProblem(File sourceFile, int lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)voidaddProblem(File sourceFile, LabelParserException e)voidaddProblem(URI sourceURI, int lineNumber, Integer column, String key, Constants.ProblemType type, Object... arguments)voidaddProblem(URI sourceURI, LabelParserException e)voidaddStatement(Statement statement)Associates a statement with this labelvoidcheckLineLengths()booleangetAllowExternalProblems()List<String>getAncestors()longgetAttachedStartByte()AttributeStatementgetAttribute(String identifier)Retrieves the attribute with the identifier or null if not foundList<AttributeStatement>getAttributes()Retrieves attributes associated with this labelbooleangetCaptureProblems()List<GroupStatement>getGroups()Retrieves groups associated with this labelList<GroupStatement>getGroups(String identifier)Retrieves the groups with the identifier or null if not foundFilegetLabelFile()StringgetLabelPath()URIgetLabelURI()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 longgetSkipBytes(Label label, Numeric startPosition)StringgetSourceNameString()StringgetSourceString()List<Statement>getStatement(DictIdentifier identifier)Retrieves a statement with the identifierList<Statement>getStatements()Retrieves the statements associated with this labelbooleanhasAncestor(File pointer)booleanhasAncestor(URI pointer)booleanhasAttachedContent()booleanhasEndStatement()booleanhasIncludePointer(String path)booleanisValid()voidsetAllowExternalProblems(boolean allowExternalProblems)voidsetAttachedStartByte(Integer startByte)voidsetCaptureProblems(boolean captureProblems)voidsetHasBlankFill(boolean hasBlankFill)voidsetHasEndStatement()voidsetInvalid()StringtoString()
-
-
-
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:
ListofGroupStatement
-
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:
ListofObjectStatement
-
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()
-
-