|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
com.agimatec.sql.SQLWriter
public class SQLWriter
The SQLWriter is responsible for simplyfying SQL-Generation by providing an API to write to a SQL-String.
$Author: stumm $
| Field Summary | |
|---|---|
protected static char |
parameterMarker
|
static byte |
STATE_BEGIN
|
static byte |
STATE_HAS_OP
|
static byte |
STATE_NEEDS_OP
|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
SQLWriter()
Initialize the new instance. |
|
SQLWriter(AliasDictionary useAliases)
Initialize the new instance with a given AliasDictionary or null |
|
| Method Summary | |
|---|---|
SQLWriter |
addParameter(Object paramValue)
Add a parameter and write the parameter marker |
void |
close()
Close the stream. |
SQLStatement |
createStatement()
Create an instance of SQLStatement from the receiver |
void |
flipStreams()
set the receivers selectStream as the stream and the stream as the selectStream. |
void |
flush()
Flush the stream. |
AliasDictionary |
getAliases()
Answer the receiver's alias dictionary. |
byte |
getOperatorState()
|
String |
getParameterizedStatement()
return the statement including parameter values instead of ? |
List |
getParameters()
return a collection of parameters provided to the reciever |
String |
getSelectString()
|
String |
getWhereString()
|
SQLWriter |
onSelect_write(String str)
does not change operator state. just write str. |
void |
setAliases(AliasDictionary aAliases)
Set the receiver's alias dictionary. |
void |
setOperatorState(byte aState)
set the operator state to the given contant. |
String |
toString()
Answer the receiver's string representation, i.e. answer the content of the underlying StringWriter. |
void |
write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(String str)
Write a string. |
void |
write(String str,
int off,
int len)
Write a portion of a string. |
SQLWriter |
writeAnd()
Write an AND token to the stream, if neccessary |
SQLWriter |
writeOperator(String operator)
|
SQLWriter |
writeOr()
Write an OR token to the stream, if neccessary |
SQLWriter |
writeParameterMarker()
Write a parameter marker to the stream. |
SQLWriter |
writeWhere()
Write a WHERE token to the stream, if neccessary |
| Methods inherited from class java.io.Writer |
|---|
append, append, append, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final char parameterMarker
public static final byte STATE_BEGIN
public static final byte STATE_HAS_OP
public static final byte STATE_NEEDS_OP
| Constructor Detail |
|---|
public SQLWriter()
public SQLWriter(AliasDictionary useAliases)
| Method Detail |
|---|
public void flipStreams()
public void close()
close in interface Closeableclose in class Writerpublic void flush()
flush in interface Flushableflush in class Writerpublic AliasDictionary getAliases()
public void setAliases(AliasDictionary aAliases)
public String toString()
toString in class Objectpublic String getSelectString()
public String getWhereString()
public String getParameterizedStatement()
public SQLStatement createStatement()
public void write(char[] cbuf,
int off,
int len)
write in class Writerpublic void write(int c)
write in class Writerpublic void write(String str)
write in class Writerpublic SQLWriter onSelect_write(String str)
public void setOperatorState(byte aState)
public byte getOperatorState()
public void write(String str,
int off,
int len)
write in class Writerpublic SQLWriter writeAnd()
public SQLWriter writeOperator(String operator)
public SQLWriter writeOr()
public SQLWriter writeParameterMarker()
public SQLWriter addParameter(Object paramValue)
public List getParameters()
public SQLWriter writeWhere()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||