thinkmap.xmlconfig.tags
Class Plugin

java.lang.Object
  extended by thinkmap.xmlconfig.tags.Plugin
All Implemented Interfaces:
IConfigTag

public class Plugin
extends Object
implements IConfigTag

Plugin allows a class to be registered with the XML configuration system. Once a plugin has been registered, the element can then be used to create and configure objects of that class.


Field Summary
protected  IBuilder builder
           
protected  Class<? extends IBuilder> builderClass
           
protected  String className
           
protected  String element
           
protected  boolean lazy
           
protected  String namespaceURI
           
protected  Namespace ns
           
protected  URL url
           
protected  boolean userDefined
           
 
Constructor Summary
Plugin()
           
 
Method Summary
 XObject build(Assembler assembler, ConfigElement thisElement, ConfigElement parent, XObject object, XObject parentObject)
           
protected  IBuilder getBuilder()
           
 String getClassName()
           
 String getNamespace()
           
 URL getURL()
           
 boolean isLazy()
           
 boolean isUserDefined()
           
 Class<?> loadClass()
           
 void setBuilderClass(Class<? extends IBuilder> c)
          Set the class that will be used to build this plugin.
 void setClass(String className)
          Set the name of the class to register.
 void setElement(String element)
          Set the xml element name the class should be regsitered under.
 void setLazy(boolean b)
          Set to true if you would like this plugin to load upon its first use.
 void setNamespace(String namespace)
          Set the namespace of the element this plugin creates.
 void setURL(URL href)
          Set the URL of the XMLComponent to register.
static Assembler wrapAssembler(Assembler assembler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lazy

protected boolean lazy

userDefined

protected boolean userDefined

namespaceURI

protected String namespaceURI

className

protected String className

element

protected String element

builder

protected IBuilder builder

url

protected URL url

ns

protected Namespace ns

builderClass

protected Class<? extends IBuilder> builderClass
Constructor Detail

Plugin

public Plugin()
Method Detail

setClass

public void setClass(String className)
Set the name of the class to register.

Parameters:
className - class name

setURL

public void setURL(URL href)
Set the URL of the XMLComponent to register. If you use this attribute, the class attribute is not required.

Parameters:
href - the URL of the XMLComponent to register.

getURL

public URL getURL()

setElement

public void setElement(String element)
Set the xml element name the class should be regsitered under.

Parameters:
element - element name

setLazy

public void setLazy(boolean b)
Set to true if you would like this plugin to load upon its first use.

Parameters:
b -

isLazy

public boolean isLazy()

setNamespace

public void setNamespace(String namespace)
Set the namespace of the element this plugin creates. If the plugin is specified within a <config:namespace> the containing namespace is used. Otherwise, the namespace is the current default namespace as defined by the parent tags of this tag.

Parameters:
namespace - namespace

getNamespace

public String getNamespace()

getBuilder

protected IBuilder getBuilder()
                       throws XMLException
Throws:
XMLException

loadClass

public Class<?> loadClass()
                   throws Exception
Throws:
Exception

getClassName

public String getClassName()

setBuilderClass

public void setBuilderClass(Class<? extends IBuilder> c)
Set the class that will be used to build this plugin. Classes must inherit from thinkmap.xmlconfig.IBuilder

Parameters:
c - the class that will be used to build this plugin.

isUserDefined

public boolean isUserDefined()

build

public XObject build(Assembler assembler,
                     ConfigElement thisElement,
                     ConfigElement parent,
                     XObject object,
                     XObject parentObject)
              throws XMLException
Specified by:
build in interface IConfigTag
Throws:
XMLException

wrapAssembler

public static Assembler wrapAssembler(Assembler assembler)


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.