groovy.lang
Class GString

java.lang.Object
  |
  +--groovy.lang.GroovyObjectSupport
        |
        +--groovy.lang.GString
All Implemented Interfaces:
GroovyObject

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 :)

Version:
$Revision: 1.3 $
Author:
James Strachan

Constructor Summary
GString(Object values)
           
GString(Object[] values)
           
 
Method Summary
abstract  String[] getStrings()
           
 Object getValue(int idx)
           
 int getValueCount()
           
 Object[] getValues()
           
 String toString()
           
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GString

public GString(Object values)

GString

public GString(Object[] values)
Method Detail

getStrings

public abstract String[] getStrings()

getValues

public Object[] getValues()

getValueCount

public int getValueCount()

getValue

public Object getValue(int idx)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003 The Codehaus. All Rights Reserved.