org.jboss.beans.metadata.plugins
Class AbstractCollectionMetaData

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.beans.metadata.plugins.AbstractValueMetaData
          extended by org.jboss.beans.metadata.plugins.AbstractTypeMetaData
              extended by org.jboss.beans.metadata.plugins.AbstractCollectionMetaData
All Implemented Interfaces:
Serializable, Cloneable, Iterable<MetaDataVisitorNode>, Collection<MetaDataVisitorNode>, TypeProvider, MetaDataVisitorNode, ValueMetaData, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractListMetaData, AbstractSetMetaData

public class AbstractCollectionMetaData
extends AbstractTypeMetaData
implements Collection<MetaDataVisitorNode>, Serializable

Collection metadata.

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

Field Summary
protected  ArrayList<MetaDataVisitorNode> collection
          The collection
protected  String elementType
          The element type
 
Fields inherited from class org.jboss.beans.metadata.plugins.AbstractTypeMetaData
beanName, configurator, context, propertyName, type
 
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
AbstractCollectionMetaData()
          Create a new collection value
 
Method Summary
 boolean add(MetaDataVisitorNode o)
           
 boolean addAll(Collection<? extends MetaDataVisitorNode> c)
           
 void clear()
           
 AbstractCollectionMetaData clone()
          Clone the object
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 Iterator<? extends MetaDataVisitorNode> getChildren()
          Return the child nodes
protected  Collection<Object> getDefaultInstance()
          Create the default collection instance
protected  org.jboss.reflect.spi.TypeInfo getElementClassInfo(ClassLoader cl, org.jboss.reflect.spi.TypeInfo info)
          Get the class info for the element type
 String getElementType()
          Get the element type
 org.jboss.reflect.spi.TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous)
          Get the injectee type info.
 Object getValue(org.jboss.reflect.spi.TypeInfo info, ClassLoader cl)
          Get the value.
 boolean isEmpty()
           
 Iterator<MetaDataVisitorNode> iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 void setElementType(String elementType)
          Set the element type
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.beans.metadata.plugins.AbstractTypeMetaData
checkResult, createInstance, getClass, getClassInfo, getClassInfo, getType, getTypeInfo, getTypeInfo, getTypeInstance, getTypeInstance, initialVisit, preinstantiatedLookup, preparePreinstantiatedLookup, setConfigurator, setType
 
Methods inherited from class org.jboss.beans.metadata.plugins.AbstractValueMetaData
describeVisit, getUnderlyingValue, getValue, isUseJMXObjectNameFix, setValue, toShortString
 
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, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 
Methods inherited from interface org.jboss.util.JBossInterface
toShortString
 

Field Detail

collection

protected ArrayList<MetaDataVisitorNode> collection
The collection


elementType

protected String elementType
The element type

Constructor Detail

AbstractCollectionMetaData

public AbstractCollectionMetaData()
Create a new collection value

Method Detail

getElementType

public String getElementType()
Get the element type

Returns:
the element type

setElementType

public void setElementType(String elementType)
Set the element type

Parameters:
elementType - the element type

getValue

public Object getValue(org.jboss.reflect.spi.TypeInfo info,
                       ClassLoader cl)
                throws Throwable
Description copied from interface: ValueMetaData
Get the value.

Specified by:
getValue in interface ValueMetaData
Overrides:
getValue in class AbstractValueMetaData
Parameters:
info - the type info
cl - the classloader
Returns:
the value.
Throws:
Throwable - for any error

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
Overrides:
getType in class AbstractValueMetaData
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

add

public boolean add(MetaDataVisitorNode o)
Specified by:
add in interface Collection<MetaDataVisitorNode>

addAll

public boolean addAll(Collection<? extends MetaDataVisitorNode> c)
Specified by:
addAll in interface Collection<MetaDataVisitorNode>

clear

public void clear()
Specified by:
clear in interface Collection<MetaDataVisitorNode>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<MetaDataVisitorNode>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<MetaDataVisitorNode>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<MetaDataVisitorNode>

iterator

public Iterator<MetaDataVisitorNode> iterator()
Specified by:
iterator in interface Iterable<MetaDataVisitorNode>
Specified by:
iterator in interface Collection<MetaDataVisitorNode>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<MetaDataVisitorNode>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<MetaDataVisitorNode>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<MetaDataVisitorNode>

size

public int size()
Specified by:
size in interface Collection<MetaDataVisitorNode>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<MetaDataVisitorNode>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<MetaDataVisitorNode>

getChildren

public Iterator<? extends MetaDataVisitorNode> getChildren()
Description copied from interface: MetaDataVisitorNode
Return the child nodes

Specified by:
getChildren in interface MetaDataVisitorNode
Overrides:
getChildren in class AbstractValueMetaData
Returns:
Iterator or null if there aren't any

toString

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

getDefaultInstance

protected Collection<Object> getDefaultInstance()
Create the default collection instance

Specified by:
getDefaultInstance in class AbstractTypeMetaData
Returns:
the class instance

getElementClassInfo

protected org.jboss.reflect.spi.TypeInfo getElementClassInfo(ClassLoader cl,
                                                             org.jboss.reflect.spi.TypeInfo info)
                                                      throws Throwable
Get the class info for the element type

Parameters:
cl - the classloader
info - the type info
Returns:
the class info
Throws:
Throwable - for any error

clone

public AbstractCollectionMetaData 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 AbstractValueMetaData
Returns:
a clone of the object


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