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 CommentStatement
comment
protected DictIdentifier
identifier
protected Label
label
protected int
lineNumber
protected File
sourceFile
protected URI
sourceURI
-
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 void
attachComment(org.antlr.runtime.Token commentToken)
int
compareTo(Object o)
CommentStatement
getComment()
Returns the comment associated with statementDictIdentifier
getIdentifier()
Retrieves the identifier for the statementLabel
getLabel()
Retrieves the label associated with this statementint
getLineNumber()
Retrieves the line for this statementFile
getSourceFile()
String
getSourceString()
URI
getSourceURI()
String
toString()
protected void
validateCommentType(DictIdentifier id)
protected void
validateElementType(DictIdentifier id)
protected void
validateGroupType(DictIdentifier id)
protected void
validateObjectType(DictIdentifier id)
protected void
validatePointerType(DictIdentifier id)
protected void
validateType(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:
compareTo
in 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)
-
-