public class ElementSymbol extends Symbol implements DerivedExpression
This is a subclass of Symbol representing a single element. An ElementSymbol also is an expression and thus has a type. Element symbols have a variety of attributes that determine how they are displayed - a flag for displaying fully qualified and an optional vdb name.
The "isExternalReference" property indicates whether the element symbol refers to an element from a group outside the current command. Typically this is set to false. Common uses when this is set to true are for variables used within a command, correlated elements within a command, etc.
Modifier and Type | Class and Description |
---|---|
static class |
ElementSymbol.DisplayMode |
LanguageObject.Util
outputName, SEPARATOR
Constructor and Description |
---|
ElementSymbol(String name)
Simple constructor taking just a name.
|
ElementSymbol(String name,
boolean displayFullyQualified)
Constructor taking a name and a flag whether to display fully qualified.
|
ElementSymbol(String shortName,
GroupSymbol group) |
ElementSymbol(String shortName,
GroupSymbol group,
Class<?> type) |
Modifier and Type | Method and Description |
---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.
|
ElementSymbol |
clone()
Return a deep copy of this object.
|
boolean |
equals(Object obj)
Compare the symbol based ONLY on name.
|
boolean |
getDisplayFullyQualified()
Get whether this element will be displayed as fully qualified
|
ElementSymbol.DisplayMode |
getDisplayMode() |
GroupSymbol |
getGroupSymbol()
Get the group symbol referred to by this element symbol, may be null before resolution
|
Object |
getMetadataID()
Get the metadata ID reference
|
String |
getName()
Get the name of the symbol
|
Class<?> |
getType()
Get the type of the symbol
|
int |
hashCode()
Return a hash code for this symbol.
|
boolean |
isAggregate() |
boolean |
isExternalReference()
Get whether this element is an external reference to a group
outside the command context.
|
void |
setAggregate(boolean isAggregate) |
void |
setDisplayFullyQualified(boolean displayFullyQualified)
Set whether this element will be displayed as fully qualified
|
void |
setDisplayMode(ElementSymbol.DisplayMode displayMode) |
void |
setGroupSymbol(GroupSymbol symbol)
Set the group symbol referred to by this element symbol
|
void |
setIsExternalReference(boolean isExternalReference)
Set whether this element is an external reference.
|
void |
setMetadataID(Object metadataID)
Set the metadata ID reference for this element
|
protected void |
setName(String name) |
void |
setType(Class<?> type)
Set the type of the symbol
|
getName, getOutputName, getOutputName, getShortName, getShortName, getShortName, setOutputName, setShortName, toString
public ElementSymbol(String name)
name
- Name of the symbol, may or may not be fully qualifiedpublic ElementSymbol(String shortName, GroupSymbol group)
public ElementSymbol(String shortName, GroupSymbol group, Class<?> type)
public ElementSymbol(String name, boolean displayFullyQualified)
name
- Name of the symboldisplayFullyQualified
- True if should display fully qualifiedpublic boolean equals(Object obj)
Symbol
public int hashCode()
Symbol
public void setDisplayMode(ElementSymbol.DisplayMode displayMode)
public ElementSymbol.DisplayMode getDisplayMode()
public void setDisplayFullyQualified(boolean displayFullyQualified)
displayFullyQualified
- True if should display fully qualifiedpublic boolean getDisplayFullyQualified()
public void setIsExternalReference(boolean isExternalReference)
isExternalReference
- True if element is an external referencepublic boolean isExternalReference()
public void setGroupSymbol(GroupSymbol symbol)
symbol
- the group symbol to setpublic GroupSymbol getGroupSymbol()
public Object getMetadataID()
public void setMetadataID(Object metadataID)
metadataID
- Metadata ID referencepublic Class<?> getType()
getType
in interface Expression
public void setType(Class<?> type)
type
- New typepublic void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor
in interface LanguageObject
visitor
- Visitor being usedpublic ElementSymbol clone()
clone
in interface LanguageObject
clone
in class Symbol
public boolean isAggregate()
public void setAggregate(boolean isAggregate)
Copyright © 2019. All rights reserved.