Package gov.nasa.pds.tools.label
Class Statement
- java.lang.Object
-
- gov.nasa.pds.tools.label.Statement
-
- All Implemented Interfaces:
Comparable<Object>
- Direct Known Subclasses:
AttributeStatement,CommentStatement,GroupStatement,ObjectStatement,PointerStatement
public abstract class Statement extends Object implements Comparable<Object>
This class represents a statement in a PDS label.- Version:
- $Revision$
- Author:
- pramirez, jagander
-
-
Field Summary
Fields Modifier and Type Field Description protected CommentStatementcommentprotected DictIdentifieridentifierprotected Labellabelprotected intlineNumberprotected FilesourceFileprotected URIsourceURI
-
Constructor Summary
Constructors Constructor Description Statement(Label sourceLabel, int lineNumber, DictIdentifier identifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachComment(org.antlr.runtime.Token commentToken)intcompareTo(Object o)CommentStatementgetComment()Returns the comment associated with statementDictIdentifiergetIdentifier()Retrieves the identifier for the statementLabelgetLabel()Retrieves the label associated with this statementintgetLineNumber()Retrieves the line for this statementFilegetSourceFile()StringgetSourceString()URIgetSourceURI()StringtoString()protected voidvalidateCommentType(DictIdentifier id)protected voidvalidateElementType(DictIdentifier id)protected voidvalidateGroupType(DictIdentifier id)protected voidvalidateObjectType(DictIdentifier id)protected voidvalidatePointerType(DictIdentifier id)protected voidvalidateType(DictIdentifier id, Class<? extends Definition> clazz)
-
-
-
Field Detail
-
lineNumber
protected final int lineNumber
-
identifier
protected final DictIdentifier identifier
-
sourceURI
protected final URI sourceURI
-
sourceFile
protected final File sourceFile
-
label
protected final Label label
-
comment
protected CommentStatement comment
-
-
Constructor Detail
-
Statement
public Statement(Label sourceLabel, int lineNumber, DictIdentifier identifier)
-
-
Method Detail
-
getLabel
public Label getLabel()
Retrieves the label associated with this statement- Returns:
- label
-
getLineNumber
public int getLineNumber()
Retrieves the line for this statement- Returns:
- The line on which the statement starts
-
getIdentifier
public DictIdentifier getIdentifier()
Retrieves the identifier for the statement- Returns:
- unique identifier
-
getSourceURI
public URI getSourceURI()
-
getSourceFile
public File getSourceFile()
-
getSourceString
public String getSourceString()
-
attachComment
public void attachComment(org.antlr.runtime.Token commentToken)
-
getComment
public CommentStatement getComment()
Returns the comment associated with statement- Returns:
- comment
-
compareTo
public int compareTo(Object o)
- Specified by:
compareToin interfaceComparable<Object>
-
validateType
protected void validateType(DictIdentifier id, Class<? extends Definition> clazz)
-
validateObjectType
protected void validateObjectType(DictIdentifier id)
-
validateGroupType
protected void validateGroupType(DictIdentifier id)
-
validateElementType
protected void validateElementType(DictIdentifier id)
-
validateCommentType
protected void validateCommentType(DictIdentifier id)
-
validatePointerType
protected void validatePointerType(DictIdentifier id)
-
-