thinkmap.xmlconfig.tags
Class Alias
java.lang.Object
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.
|
Constructor Summary |
Alias()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
namespace
protected String namespace
methodSpec
protected String methodSpec
alias
protected String alias
Alias
public Alias()
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.