com.caucho.config.type
Class ConfigType<T>

java.lang.Object
  extended by com.caucho.config.type.ConfigType<T>
Direct Known Subclasses:
AnnotationInterfaceType, AnnotationType, ArrayType, BooleanPrimitiveType, BooleanType, BytePrimitiveType, ByteType, CharacterPrimitiveType, CharacterType, ClassType, DataSourceType, DateType, DoublePrimitiveType, DoubleType, EnumType, ExprType, FileType, FloatPrimitiveType, FloatType, InlineBeanType, IntegerPrimitiveType, IntegerType, InterfaceType, LevelBuilder, ListType, LocaleType, LongPrimitiveType, LongType, MapType, MethodExpressionType, NodeType, NotFoundConfigType, NullType, ObjectType, PathType, PatternType, PropertiesType, PropertyEditorType, QDateType, RawStringArrayType, RawStringType, SetType, ShortPrimitiveType, ShortType, StringArrayType, StringType, UrlType, ValueExpressionType, ValueType, XmlBeanType

public abstract class ConfigType<T>
extends java.lang.Object

Represents an introspected configuration type.


Constructor Summary
ConfigType()
           
 
Method Summary
 void afterConfigure(XmlConfigContext builder, java.lang.Object bean)
          Called after the children are configured.
 void beforeConfigure(XmlConfigContext builder, java.lang.Object bean, org.w3c.dom.Node node)
          Called before the children are configured.
 void beforeConfigureBean(XmlConfigContext builder, java.lang.Object bean, org.w3c.dom.Node node)
          Called before the children are configured.
 void carefulIntrospect()
           
 java.lang.Object create(java.lang.Object parent, QName name)
          Creates a new instance of the type.
 ConfigType<?> createType(QName name)
          Creates a top-level instance of the type.
 Attribute getAddAttribute(java.lang.Class<?> cl)
          Returns any add attributes to add arbitrary content
 Attribute getAddBeanAttribute(QName qName)
           
 Attribute getAttribute(QName qName)
          Returns the attribute with the given name.
 ConfigType<?> getComponentType()
           
 java.lang.reflect.Constructor<?> getConstructor(int count)
          Returns the constructor with the given number of arguments
 Attribute getContentProgramAttribute()
          Returns the flow program attribute, i.e.
 Attribute getDefaultAttribute(QName qName)
           
 Attribute getProgramAttribute()
          Returns the program attribute.
abstract  java.lang.Class<T> getType()
          Returns the Java type.
 ConfigType<?> getType(java.lang.Object childBean)
          Returns the config type of the child bean.
 java.lang.String getTypeName()
          Returns a printable name of the type.
 void init(java.lang.Object bean)
          Initialize the type
 void inject(java.lang.Object bean)
          Inject and initialize the type
 void introspect()
          Introspect the type.
 boolean isArray()
          Returns true for an array type
 boolean isBean()
          Returns true for a bean-style type.
 boolean isConstructableFromString()
           
 boolean isEL()
          Return true for EL evaluation
 boolean isEnvBean()
          Returns true for an environment bean.
 boolean isInlineType(ConfigType<?> type)
           
 boolean isNode()
          Returns true for an XML node type.
 boolean isNoTrim()
          Return true for non-trim.
 boolean isProgram()
          Returns true for a program type.
 boolean isQualifier()
          Returns true for a qualifier annotation
 boolean isReplace()
          Return true if the object is replaced
 java.lang.Object replaceObject(java.lang.Object bean)
          Replace the type with the generated object
 void setEnvBean(boolean isEnvBean)
          Returns true for an environment bean.
 boolean setProperty(java.lang.Object bean, QName name, java.lang.Object value)
          Sets a property based on an attribute name, returning true if successful.
 java.lang.String toString()
           
 java.lang.Object valueOf(ELContext env, Expr value)
          Converts the value to a value of the type.
 java.lang.Object valueOf(java.lang.Object value)
          Converts the value to a value of the type.
abstract  java.lang.Object valueOf(java.lang.String text)
          Converts the string to a value of the type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfigType

public ConfigType()
Method Detail

getType

public abstract java.lang.Class<T> getType()
Returns the Java type.


carefulIntrospect

public void carefulIntrospect()

introspect

public void introspect()
Introspect the type.


getTypeName

public java.lang.String getTypeName()
Returns a printable name of the type.


create

public java.lang.Object create(java.lang.Object parent,
                               QName name)
Creates a new instance of the type.


createType

public ConfigType<?> createType(QName name)
Creates a top-level instance of the type.


getType

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


inject

public void inject(java.lang.Object bean)
Inject and initialize the type


init

public void init(java.lang.Object bean)
Initialize the type


replaceObject

public java.lang.Object replaceObject(java.lang.Object bean)
Replace the type with the generated object


getConstructor

public java.lang.reflect.Constructor<?> getConstructor(int count)
Returns the constructor with the given number of arguments


valueOf

public abstract java.lang.Object valueOf(java.lang.String text)
Converts the string to a value of the type.


valueOf

public java.lang.Object valueOf(java.lang.Object value)
Converts the value to a value of the type.


valueOf

public java.lang.Object valueOf(ELContext env,
                                Expr value)
Converts the value to a value of the type.


isBean

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


isNode

public boolean isNode()
Returns true for an XML node type.


isNoTrim

public boolean isNoTrim()
Return true for non-trim.


isEL

public boolean isEL()
Return true for EL evaluation


isArray

public boolean isArray()
Returns true for an array type


isReplace

public boolean isReplace()
Return true if the object is replaced


isQualifier

public boolean isQualifier()
Returns true for a qualifier annotation


isProgram

public boolean isProgram()
Returns true for a program type.


getComponentType

public ConfigType<?> getComponentType()

getDefaultAttribute

public Attribute getDefaultAttribute(QName qName)

getAddBeanAttribute

public Attribute getAddBeanAttribute(QName qName)

getAttribute

public Attribute getAttribute(QName qName)
Returns the attribute with the given name.


setProperty

public boolean setProperty(java.lang.Object bean,
                           QName name,
                           java.lang.Object value)
Sets a property based on an attribute name, returning true if successful.


getProgramAttribute

public Attribute getProgramAttribute()
Returns the program attribute.


getContentProgramAttribute

public Attribute getContentProgramAttribute()
Returns the flow program attribute, i.e. attributes that also save if/choose without interpreting.


getAddAttribute

public Attribute getAddAttribute(java.lang.Class<?> cl)
Returns any add attributes to add arbitrary content


beforeConfigureBean

public void beforeConfigureBean(XmlConfigContext builder,
                                java.lang.Object bean,
                                org.w3c.dom.Node node)
Called before the children are configured.


beforeConfigure

public void beforeConfigure(XmlConfigContext builder,
                            java.lang.Object bean,
                            org.w3c.dom.Node node)
Called before the children are configured. Also called for attribute configuration, e.g. for macros and web-app-default.


afterConfigure

public void afterConfigure(XmlConfigContext builder,
                           java.lang.Object bean)
Called after the children are configured.


isConstructableFromString

public boolean isConstructableFromString()

isInlineType

public boolean isInlineType(ConfigType<?> type)

isEnvBean

public boolean isEnvBean()
Returns true for an environment bean.


setEnvBean

public void setEnvBean(boolean isEnvBean)
Returns true for an environment bean.


toString

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