thinkmap.datasource.database
Class CustomQueryGenerator

java.lang.Object
  extended by thinkmap.datasource.database.CustomQueryGenerator

public class CustomQueryGenerator
extends Object

Something that takes a DatabaseDataSource and generates XML that represents what XML a user would need to make custom queries instead of relying on the automatically generated queries.

Version:
$Revision: 1.12 $

Constructor Summary
CustomQueryGenerator()
           
 
Method Summary
protected  void addBinding(StringBuffer sb, Binding b)
           
protected  void addRelation(StringBuffer sb, EntityRelation relation)
           
protected  void decreaseIndent()
          Decrease the indent level
 String generateXML(DatabaseDataSource dbds)
           
protected  void increaseIndent()
          Increase the indent level
protected  void print(StringBuffer sb, String str)
          Add something to a StringBuffer, indenting if we're at the start of a line.
protected  void println(StringBuffer sb, String str)
          Add something to a StringBuffer with a return, indenting if we're at the start of a line.
 void XMLEncodeCDATA(StringBuffer result, String s)
          Encode a string as CDATA, if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomQueryGenerator

public CustomQueryGenerator()
Method Detail

generateXML

public String generateXML(DatabaseDataSource dbds)

addRelation

protected void addRelation(StringBuffer sb,
                           EntityRelation relation)

addBinding

protected void addBinding(StringBuffer sb,
                          Binding b)

print

protected final void print(StringBuffer sb,
                           String str)
Add something to a StringBuffer, indenting if we're at the start of a line.


println

protected final void println(StringBuffer sb,
                             String str)
Add something to a StringBuffer with a return, indenting if we're at the start of a line.


increaseIndent

protected void increaseIndent()
Increase the indent level


decreaseIndent

protected void decreaseIndent()
Decrease the indent level


XMLEncodeCDATA

public final void XMLEncodeCDATA(StringBuffer result,
                                 String s)
                          throws IllegalArgumentException
Encode a string as CDATA, if possible. Throws an exception if the string itself contains the sequence "]]>" which marks the end of a CDATA section, or some illegal Unicode char.

Parameters:
result - StringBuffer to which the result should be appended.
s - String to encode.
Throws:
IllegalArgumentException - if the String contains characters or character sequences which can not be encoded as CDATA.


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.