org.jboss.beans.metadata.plugins
Class AbstractPropertyMetaData

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.beans.metadata.plugins.AbstractFeatureMetaData
          extended by org.jboss.beans.metadata.plugins.AbstractPropertyMetaData
All Implemented Interfaces:
Serializable, Cloneable, TypeProvider, ValueMetaDataAware, FeatureMetaData, MetaDataVisitorNode, PropertyMetaData, org.jboss.util.JBossInterface

public class AbstractPropertyMetaData
extends AbstractFeatureMetaData
implements PropertyMetaData, ValueMetaDataAware, TypeProvider, Serializable

Metadata for a property.

Version:
$Revision: 81671 $
Author:
Ales Justin, Adrian Brock
See Also:
Serialized Form

Field Summary
protected  String name
          The property name
protected  boolean preInstantiate
          The preinstantiate
protected  String type
          The property type
protected  ValueMetaData value
          The property value
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Fields inherited from interface org.jboss.beans.metadata.plugins.TypeProvider
ERROR_MSG
 
Constructor Summary
AbstractPropertyMetaData()
          Create a new property meta data
AbstractPropertyMetaData(String name, Object value)
          Create a new property meta data
AbstractPropertyMetaData(String name, String value)
          Create a new property meta data
AbstractPropertyMetaData(String name, String value, String type)
          Create a new property meta data
AbstractPropertyMetaData(String name, ValueMetaData value)
          Create a new attribute meta data
 
Method Summary
 void addChildren(Set<MetaDataVisitorNode> children)
           
 AbstractPropertyMetaData clone()
          Clone the object
 String getName()
          Get the name.
 String getPropertyType()
           
 String getType()
          Get property type if possible.
 org.jboss.reflect.spi.TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous)
          Get the injectee type info.
 ValueMetaData getValue()
          Get the value.
 void initialVisit(MetaDataVisitor visitor)
          Visit the node
 boolean isPreInstantiate()
          Get the preinstantiate flag.
 void setName(String name)
          Set the name
 void setPreInstantiate(boolean preInstantiate)
           
 void setPropertyReplace(boolean replace)
           
 void setPropertyTrim(boolean trim)
           
 void setPropertyType(String type)
           
 void setValue(ValueMetaData value)
          Set the value
 void setValueObject(Object value)
           
 void setValueString(String value)
           
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.beans.metadata.plugins.AbstractFeatureMetaData
applyCollectionOrMapCheck, describeVisit, doClone, getAnnotations, getChildren, getDescription, setAnnotations, setDescription
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.beans.metadata.spi.FeatureMetaData
getAnnotations, getDescription
 
Methods inherited from interface org.jboss.util.JBossInterface
toShortString
 
Methods inherited from interface org.jboss.beans.metadata.spi.MetaDataVisitorNode
describeVisit, getChildren
 

Field Detail

name

protected String name
The property name


preInstantiate

protected boolean preInstantiate
The preinstantiate


value

protected ValueMetaData value
The property value


type

protected String type
The property type

Constructor Detail

AbstractPropertyMetaData

public AbstractPropertyMetaData()
Create a new property meta data


AbstractPropertyMetaData

public AbstractPropertyMetaData(String name,
                                Object value)
Create a new property meta data

Parameters:
name - the name
value - the value

AbstractPropertyMetaData

public AbstractPropertyMetaData(String name,
                                String value)
Create a new property meta data

Parameters:
name - the name
value - the string value

AbstractPropertyMetaData

public AbstractPropertyMetaData(String name,
                                ValueMetaData value)
Create a new attribute meta data

Parameters:
name - the name
value - the value meta data

AbstractPropertyMetaData

public AbstractPropertyMetaData(String name,
                                String value,
                                String type)
Create a new property meta data

Parameters:
name - the name
value - the string value
type - the type
Method Detail

getName

public String getName()
Description copied from interface: PropertyMetaData
Get the name.

Specified by:
getName in interface PropertyMetaData
Returns:
the name.

setName

public void setName(String name)
Set the name

Parameters:
name - the name

getType

public String getType()
Description copied from interface: PropertyMetaData
Get property type if possible.

Specified by:
getType in interface PropertyMetaData
Returns:
class type if set, otherwise null

isPreInstantiate

public boolean isPreInstantiate()
Description copied from interface: PropertyMetaData
Get the preinstantiate flag.

Specified by:
isPreInstantiate in interface PropertyMetaData
Returns:
the preinstantiate flag

setPreInstantiate

public void setPreInstantiate(boolean preInstantiate)

getValue

public ValueMetaData getValue()
Description copied from interface: PropertyMetaData
Get the value.

Specified by:
getValue in interface ValueMetaDataAware
Specified by:
getValue in interface PropertyMetaData
Returns:
the value.

setValue

public void setValue(ValueMetaData value)
Set the value

Specified by:
setValue in interface ValueMetaDataAware
Parameters:
value - the value

setValueObject

public void setValueObject(Object value)

setValueString

public void setValueString(String value)

getPropertyType

public String getPropertyType()

setPropertyType

public void setPropertyType(String type)

setPropertyReplace

public void setPropertyReplace(boolean replace)

setPropertyTrim

public void setPropertyTrim(boolean trim)

initialVisit

public void initialVisit(MetaDataVisitor visitor)
Description copied from interface: MetaDataVisitorNode
Visit the node

Specified by:
initialVisit in interface MetaDataVisitorNode
Overrides:
initialVisit in class AbstractFeatureMetaData
Parameters:
visitor - the visitor

addChildren

public void addChildren(Set<MetaDataVisitorNode> children)
Overrides:
addChildren in class AbstractFeatureMetaData

getType

public org.jboss.reflect.spi.TypeInfo getType(MetaDataVisitor visitor,
                                              MetaDataVisitorNode previous)
                                       throws Throwable
Description copied from interface: TypeProvider
Get the injectee type info.

Specified by:
getType in interface TypeProvider
Parameters:
visitor - meda data visitor
previous - previous node in the stack
Returns:
TypeInfo type info for injection ByClass
Throws:
Throwable - if could not determine class

toString

public void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class AbstractFeatureMetaData

toShortString

public void toShortString(org.jboss.util.JBossStringBuilder buffer)
Specified by:
toShortString in interface org.jboss.util.JBossInterface
Overrides:
toShortString in class AbstractFeatureMetaData

clone

public AbstractPropertyMetaData clone()
Description copied from interface: MetaDataVisitorNode
Clone the object

Specified by:
clone in interface MetaDataVisitorNode
Specified by:
clone in interface org.jboss.util.JBossInterface
Overrides:
clone in class org.jboss.util.JBossObject
Returns:
a clone of the object


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.