Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.directwebremoting
Class ScriptBuffer

    java.lang.Object
      org.directwebremoting.ScriptBuffer

    public class ScriptBuffer

extends java.lang.Object

A ScriptBuffer is like a StringBuffer except that it is used to create Javascript commands. There are 2 version of the `append()` method:

The first is `appendScript(String)` which assumes that the parameter is to be inserted literally into the output.

The second is `appendData(String)` (and variants for Object and primitive types) which assumes that the parameter is a variable which should be properly converted, escaped and quoted.

Author:
  Joe Walker [joe at getahead dot ltd dot uk]

Nested Class Summary
`class` | `ScriptBuffer.StringWrapper` A wrapper around a string to distinguish a string entered into this buffer as code and a string entered as data

Constructor Summary
`ScriptBuffer()` Create an empty ScriptBuffer.
`ScriptBuffer(java.lang.String str)` Create a ScriptBuffer with some initial content.

Method Summary
`ScriptBuffer` | `appendData(boolean b)`
`ScriptBuffer` | `appendData(char c)`
`ScriptBuffer` | `appendData(double d)`
`ScriptBuffer` | `appendData(float f)`
`ScriptBuffer` | `appendData(int i)`
`ScriptBuffer` | `appendData(long l)`
`ScriptBuffer` | `appendData(java.lang.Object obj)`
`ScriptBuffer` | `appendData(java.lang.String str)`
`ScriptBuffer` | `appendScript(java.lang.String str)`
`java.util.List` | `getParts()` For DWR use only - This method is not part of the public API.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ScriptBuffer

    public ScriptBuffer()

  Create an empty ScriptBuffer.

### ScriptBuffer

    public ScriptBuffer(java.lang.String str)

  Create a ScriptBuffer with some initial content. `appendScript(String)` is called with the passed string

  Parameters:
    `str` - The initial string to place in the buffer

Method Detail

### appendScript

    public ScriptBuffer appendScript(java.lang.String str)

  Parameters:
    `str` - The String to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(java.lang.String)`

### appendData

    public ScriptBuffer appendData(boolean b)

  Parameters:
    `b` - The boolean to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(boolean)`

### appendData

    public ScriptBuffer appendData(char c)

  Parameters:
    `c` - The char to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(char)`

### appendData

    public ScriptBuffer appendData(double d)

  Parameters:
    `d` - The double to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(double)`

### appendData

    public ScriptBuffer appendData(float f)

  Parameters:
    `f` - The float to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(float)`

### appendData

    public ScriptBuffer appendData(int i)

  Parameters:
    `i` - The int to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(int)`

### appendData

    public ScriptBuffer appendData(long l)

  Parameters:
    `l` - The long to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(long)`

### appendData

    public ScriptBuffer appendData(java.lang.Object obj)

  Parameters:
    `obj` - The Object to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(java.lang.Object)`

### appendData

    public ScriptBuffer appendData(java.lang.String str)

  Parameters:
    `str` - The String to add to the script
  Returns:
    this. To allow sv.append(x).append(y).append(z);
  See Also:
    `StringBuffer.append(java.lang.String)`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### getParts

    public java.util.List getParts()

  For DWR use only - This method is not part of the public API. Do not use it without understanding the implications for future proofing.

  Returns:
    The list of parts of the final output script

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¬ 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD