com.caucho.config.attribute
Class Attribute

java.lang.Object
  extended by com.caucho.config.attribute.Attribute
Direct Known Subclasses:
AddAttribute, AnnotationAttribute, CreateAttribute, EntryAttribute, EnvironmentAttribute, ListValueAttribute, ProgramAttribute, PropertyAttribute, SetterAttribute, SetValueAttribute, TextAttribute, XmlBeanAddAttribute, XmlBeanAnnotationAttribute, XmlBeanArgAttribute, XmlBeanAttribute, XmlBeanFieldAttribute, XmlBeanMethodAttribute, XmlBeanNewAttribute, XmlBeanProgramAttribute, XmlBeanValueArgAttribute

public abstract class Attribute
extends java.lang.Object


Constructor Summary
Attribute()
           
 
Method Summary
 java.lang.Object create(java.lang.Object parent, QName name)
          Creates the child bean.
 java.lang.Object create(java.lang.Object parent, QName name, ConfigType<?> type)
          Creates the child bean.
abstract  ConfigType<?> getConfigType()
          Returns the config type of the attribute value.
 ConfigType<?> getType(java.lang.Object childBean)
          Returns the config type of the child bean.
 boolean isAllowInline()
          True if it allows inline beans
 boolean isAllowText()
          True if it allows text.
 boolean isAssignableFrom(Attribute oldAttr)
           
 boolean isAssignableFrom(ConfigType<?> type)
           
 boolean isBean()
          Returns true for a bean-style attribute.
 boolean isConfigurable()
          True if the attribute is annotated with a @Configurable
 boolean isEL()
          Returns true for an EL attribute.
 boolean isInlineType(ConfigType<?> type)
          True if the inline type matches
 boolean isNode()
          Returns true for a node attribute.
 boolean isProgram()
          Returns true for a program-style attribute.
 boolean isSetter()
          Returns true for attributes which create objects.
 java.lang.Object replaceObject(java.lang.Object bean)
          Replaces the given bean.
 void setText(java.lang.Object bean, QName name, java.lang.String value)
          Sets the value of the attribute as text
abstract  void setValue(java.lang.Object bean, QName name, java.lang.Object value)
          Sets the value of the attribute
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute()
Method Detail

getConfigType

public abstract ConfigType<?> getConfigType()
Returns the config type of the attribute value.


isBean

public boolean isBean()
Returns true for a bean-style attribute.


isEL

public boolean isEL()
Returns true for an EL attribute.


isNode

public boolean isNode()
Returns true for a node attribute.


isProgram

public boolean isProgram()
Returns true for a program-style attribute.


isAllowInline

public boolean isAllowInline()
True if it allows inline beans


isInlineType

public boolean isInlineType(ConfigType<?> type)
True if the inline type matches


isAllowText

public boolean isAllowText()
True if it allows text.


isConfigurable

public boolean isConfigurable()
True if the attribute is annotated with a @Configurable


isAssignableFrom

public boolean isAssignableFrom(Attribute oldAttr)

isAssignableFrom

public boolean isAssignableFrom(ConfigType<?> type)

setText

public void setText(java.lang.Object bean,
                    QName name,
                    java.lang.String value)
             throws ConfigException
Sets the value of the attribute as text

Throws:
ConfigException

setValue

public abstract void setValue(java.lang.Object bean,
                              QName name,
                              java.lang.Object value)
                       throws ConfigException
Sets the value of the attribute

Throws:
ConfigException

isSetter

public boolean isSetter()
Returns true for attributes which create objects.


create

public java.lang.Object create(java.lang.Object parent,
                               QName name,
                               ConfigType<?> type)
                        throws ConfigException
Creates the child bean.

Throws:
ConfigException

create

public java.lang.Object create(java.lang.Object parent,
                               QName name)
                        throws ConfigException
Creates the child bean.

Throws:
ConfigException

getType

public ConfigType<?> getType(java.lang.Object childBean)
Returns the config type of the child bean.


replaceObject

public java.lang.Object replaceObject(java.lang.Object bean)
Replaces the given bean.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object