public class Identifier extends Object implements Comparable<Identifier>
Constructor and Description |
---|
Identifier(String text,
boolean quoted)
Constructs an identifier instance.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
areEqual(Identifier id1,
Identifier id2) |
int |
compareTo(Identifier o) |
boolean |
equals(Object o) |
String |
getCanonicalName() |
String |
getText()
Get the identifiers name (text)
|
int |
hashCode() |
boolean |
isQuoted()
Is this a quoted identifier>
|
static boolean |
isQuoted(String name)
Is the given identifier text considered quoted.
|
static Identifier |
quote(Identifier identifier) |
String |
render() |
String |
render(Dialect dialect)
If this is a quoted identifier, then return the identifier name
enclosed in dialect-specific open- and end-quotes; otherwise,
simply return the unquoted identifier.
|
static Identifier |
toIdentifier(String text)
Means to generate an
Identifier instance from its simple text form. |
static Identifier |
toIdentifier(String text,
boolean quote)
Means to generate an
Identifier instance from its simple text form. |
String |
toString() |
public Identifier(String text, boolean quoted)
text
- The identifier text.quoted
- Is this a quoted identifier?public static Identifier toIdentifier(String text)
Identifier
instance from its simple text form.
If passed text is null
, null
is returned.
If passed text is surrounded in quote markers, the generated Identifier
is considered quoted. Quote markers include back-ticks (`), and
double-quotes (").text
- The text formnull
if text was null
public static Identifier toIdentifier(String text, boolean quote)
Identifier
instance from its simple text form.
If passed text is null
, null
is returned.
If passed text is surrounded in quote markers, the generated Identifier
is considered quoted. Quote markers include back-ticks (`), and
double-quotes (").text
- The text formquote
- Whether to quote unquoted text formsnull
if text was null
public static boolean isQuoted(String name)
`name`
[name]
"name"
name
- public String getText()
public boolean isQuoted()
public String render(Dialect dialect)
dialect
- The dialect whose dialect-specific quoting should be used.public String render()
public String getCanonicalName()
public static boolean areEqual(Identifier id1, Identifier id2)
public static Identifier quote(Identifier identifier)
public int compareTo(Identifier o)
compareTo
in interface Comparable<Identifier>
Copyright © 2016 JBoss by Red Hat. All rights reserved.