cookxml.cookswing
Class CookSwing

java.lang.Object
  extended bycookxml.core.CookXml
      extended bycookxml.cookswing.CookSwing

public class CookSwing
extends CookXml

This class basically customizes CookXml for Swing.

Since:
CookSwing 1.0

Constructor Summary
CookSwing()
          create a cookswing which does not really use variables.
CookSwing(Object varObj)
          create a cookswing with an object in which all variable names are looked up.
CookSwing(Object varObj, ClassLoader classLoader)
          create a cookswing with an object in which all variable names are looked up.
CookSwing(VarLookup varLookup)
          create a cookswing with a variable lookup handler.
CookSwing(VarLookup varLookup, ClassLoader classLoader)
          create a cookswing with a variable lookup handler.
 
Method Summary
 Container getRootContainer()
          another short cut for getting the root object of the xml document and do type casting at the same time.
static DocumentBuilder getSwingDocumentBuilder()
          Get the default DocumentBuilder for creating a CookSwing object.
static InheritableTagLibrary getSwingTagLibrary()
          Get the system wide swing tag library.
 Container render(Object input)
          just a short cut to call xmlDecode to avoid type casting.
static void setSwingDocumentBuilder(DocumentBuilder docBuilder)
          Set the default DocumentBuilder used for creating a CookSwing object.
static void setSwingTagLibrary(InheritableTagLibrary tagLibrary)
          If you don't like the current swingTabLibrary, it is possible to replace it with your own.
static void setSystemResourceBundle(ResourceBundle bundle)
          set the system wide resource bundle for string translation.
 
Methods inherited from class cookxml.core.CookXml
debug, debug, debug, getClassLoader, getDefaultClassLoader, getDefaultExceptionHandler, getDocumentBuilder, getExceptionHandler, getId, getResourceBundle, getRootObject, getTagLibrary, getVarLookup, isAccessible, isDefaultAccessible, setAccessible, setClassLoader, setDefaultAccessible, setDefaultClassLoader, setDefaultExceptionHandler, setDocumentBuilder, setExceptionHandler, setId, setResourceBundle, setRootObject, setVarLookup, xmlDecode, xmlDecode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookSwing

public CookSwing()
create a cookswing which does not really use variables.


CookSwing

public CookSwing(VarLookup varLookup)
create a cookswing with a variable lookup handler.

Parameters:
varLookup - the handler for handling variable lookup

CookSwing

public CookSwing(Object varObj)
create a cookswing with an object in which all variable names are looked up.

Parameters:
varObj - the object in which all variable names are looked up.

CookSwing

public CookSwing(VarLookup varLookup,
                 ClassLoader classLoader)
create a cookswing with a variable lookup handler.

Parameters:
varLookup - the handler for handling variable lookup
classLoader - the ClassLoader used to locate resources.

CookSwing

public CookSwing(Object varObj,
                 ClassLoader classLoader)
create a cookswing with an object in which all variable names are looked up.

Parameters:
varObj - the object in which all variable names are looked up.
classLoader - the ClassLoader used to locate resources.
Method Detail

setSwingTagLibrary

public static void setSwingTagLibrary(InheritableTagLibrary tagLibrary)
If you don't like the current swingTabLibrary, it is possible to replace it with your own. Or better yet, overload CookXml yourself.

Parameters:
tagLibrary - the tag library to be set

getSwingTagLibrary

public static InheritableTagLibrary getSwingTagLibrary()
Get the system wide swing tag library. If the user did not setup a version of swing tag library. A default library is created.

Returns:
the system wide swing tag library.

getSwingDocumentBuilder

public static DocumentBuilder getSwingDocumentBuilder()
Get the default DocumentBuilder for creating a CookSwing object.

Returns:
the default DocumentBuilder for creating a CookSwing object.

setSwingDocumentBuilder

public static void setSwingDocumentBuilder(DocumentBuilder docBuilder)
Set the default DocumentBuilder used for creating a CookSwing object.

Parameters:
docBuilder - the document builder for XML documents.

setSystemResourceBundle

public static void setSystemResourceBundle(ResourceBundle bundle)
set the system wide resource bundle for string translation.

Parameters:
bundle - the resource bundle to be used.

render

public Container render(Object input)
just a short cut to call xmlDecode to avoid type casting.

Parameters:
input - document input source
Returns:
the container object

getRootContainer

public Container getRootContainer()
another short cut for getting the root object of the xml document and do type casting at the same time.

Returns:
the root object which is a container.