|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport groovy.lang.GString
public abstract class GString extends GroovyObjectSupport
Represents a String which contains embedded values such as "hello there ${user} how are you?" which can be evaluated lazily. Advanced users can iterate over the text and values to perform special processing, such as for performing SQL operations, the values can be substituted for ? and the actual value objects can be bound to a JDBC statement. The lovely name of this class was suggested by Jules Gosnell and was such a good idea, I couldn't resist :)
Field Summary | |
---|---|
static GString |
EMPTY
A GString containing a single empty String and no values. |
Constructor Summary | |
GString(java.lang.Object values)
|
|
GString(java.lang.Object[] values)
|
Method Summary | |
---|---|
void
|
build(GroovyObject builder)
|
char
|
charAt(int index)
|
int
|
compareTo(java.lang.Object that)
|
boolean
|
equals(java.lang.Object that)
|
boolean
|
equals(GString that)
|
byte[]
|
getBytes()
|
byte[]
|
getBytes(java.lang.String charset)
|
java.lang.String[]
|
getStrings()
|
java.lang.Object
|
getValue(int idx)
|
int
|
getValueCount()
|
java.lang.Object[]
|
getValues()
|
int
|
hashCode()
|
java.lang.Object
|
invokeMethod(java.lang.String name, java.lang.Object args)
Overloaded to implement duck typing for Strings so that any method that can't be evaluated on this object will be forwarded to the toString() object instead. |
int
|
length()
|
java.util.regex.Pattern
|
negate()
Turns a String into a regular expression pattern |
GString
|
plus(GString that)
|
GString
|
plus(java.lang.String that)
|
java.lang.CharSequence
|
subSequence(int start, int end)
|
java.lang.String
|
toString()
|
java.io.Writer
|
writeTo(java.io.Writer out)
|
Methods inherited from class GroovyObjectSupport | |
---|---|
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
public static final GString EMPTY
Constructor Detail |
---|
public GString(java.lang.Object values)
public GString(java.lang.Object[] values)
Method Detail |
---|
public void build(GroovyObject builder)
public char charAt(int index)
public int compareTo(java.lang.Object that)
public boolean equals(java.lang.Object that)
public boolean equals(GString that)
public byte[] getBytes()
public byte[] getBytes(java.lang.String charset)
public java.lang.String[] getStrings()
public java.lang.Object getValue(int idx)
public int getValueCount()
public java.lang.Object[] getValues()
public int hashCode()
public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
public int length()
public java.util.regex.Pattern negate()
public GString plus(GString that)
public GString plus(java.lang.String that)
public java.lang.CharSequence subSequence(int start, int end)
public java.lang.String toString()
public java.io.Writer writeTo(java.io.Writer out)
Groovy Documentation