public class NameSegment extends Object implements IdentifierSegment
KeySegment| Constructor and Description |
|---|
NameSegment(ParseRegion region,
String name,
Quoting quoting)
Creates a segment with the given quoting and region.
|
NameSegment(String name)
Creates a quoted segment, "[name]".
|
| Modifier and Type | Method and Description |
|---|---|
List<NameSegment> |
getKeyParts()
Returns the key components, if this IdentifierSegment is a key.
|
String |
getName()
Returns the name of this IdentifierSegment.
|
Quoting |
getQuoting()
Returns how this Segment is quoted.
|
ParseRegion |
getRegion()
Returns the region of the source code which this Segment was created
from, if it was created by parsing.
|
String |
toString()
Returns a string representation of this Segment.
|
void |
toString(StringBuilder buf)
Appends a string representation of this Segment to a StringBuffer.
|
public NameSegment(ParseRegion region, String name, Quoting quoting)
region - Region of source codename - Namequoting - Quoting stylepublic NameSegment(String name)
name - Name of segmentpublic String toString()
IdentifierSegmentFor example, "[Foo]", "&[123]", "Abc".
toString in interface IdentifierSegmenttoString in class Objectpublic void toString(StringBuilder buf)
IdentifierSegmenttoString in interface IdentifierSegmentbuf - StringBufferpublic ParseRegion getRegion()
IdentifierSegmentgetRegion in interface IdentifierSegmentpublic String getName()
IdentifierSegmentnull if this IdentifierSegment represents a key.getName in interface IdentifierSegmentpublic Quoting getQuoting()
IdentifierSegmentgetQuoting in interface IdentifierSegmentpublic List<NameSegment> getKeyParts()
IdentifierSegmentIdentifierSegment.getQuoting() returns
Quoting.KEY.)
Returns null otherwise.getKeyParts in interface IdentifierSegment