thinkmap.xmlconfig.tags
Class Alias

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

public class Alias
extends Object
implements IConfigTag

Alias allows a class' method to be registered under a different name for use in xml configuraion. For example, if the class mypackage.MyClass had a method setClazz(Class c) and you would like that method to be visible in xml as an attribute named class (instead of clazz), you would specify the following:

<config:alias method="mypackage.MyClass.setClazz(java.lang.Class)" alias="class" />
Note: the class name and argument types must either be fully qualified, unless they are in the java.lang package, or have been imported using the <config:import> tag.


Field Summary
protected  String alias
           
protected  String methodSpec
           
protected  String namespace
           
 
Constructor Summary
Alias()
           
 
Method Summary
 XObject build(Assembler assembler, ConfigElement thisElement, ConfigElement parent, XObject object, XObject parentObject)
           
 String getAlias()
           
 String getMethod()
           
 String getNamespace()
           
 void setAlias(String alias)
          Set the id you want to use when you refer to the method.
 void setMethod(String methodSpec)
          Set the name of the method you want to have aliased
 void setNamespace(String namespace)
          Set the namespace of this alias.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespace

protected String namespace

methodSpec

protected String methodSpec

alias

protected String alias
Constructor Detail

Alias

public Alias()
Method Detail

getAlias

public String getAlias()
Returns:
Returns the alias.

setAlias

public void setAlias(String alias)
Set the id you want to use when you refer to the method.

Parameters:
alias - The alias to set.

getMethod

public String getMethod()
Returns:
Returns the methodSpec.

setMethod

public void setMethod(String methodSpec)
Set the name of the method you want to have aliased

Parameters:
methodSpec - The methodSpec to set.

getNamespace

public String getNamespace()
Returns:
Returns the namespace.

setNamespace

public void setNamespace(String namespace)
Set the namespace of this alias. If the alias is specified within a <config:namespace> the containing namespace can be used. Otherwise, this is required.

Parameters:
namespace - The namespace to set.

build

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


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.