org.jboss.beans.metadata.plugins
Class AbstractMapMetaData

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.AbstractMapMetaData
All Implemented Interfaces:
Serializable, Cloneable, Map<MetaDataVisitorNode,MetaDataVisitorNode>, TypeProvider, MetaDataVisitorNode, ValueMetaData, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractPropertiesMetaData

public class AbstractMapMetaData
extends AbstractTypeMetaData
implements Map<MetaDataVisitorNode,MetaDataVisitorNode>, Serializable

Map metadata.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
protected  String keyType
          The key type
protected  String valueType
          The value 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
AbstractMapMetaData()
          Create a new map value
 
Method Summary
 void clear()
           
 AbstractMapMetaData clone()
          Clone the object
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<MetaDataVisitorNode,MetaDataVisitorNode>> entrySet()
           
 MetaDataVisitorNode get(Object key)
           
 Iterator<? extends MetaDataVisitorNode> getChildren()
          Return the child nodes
protected  Object getDefaultInstance()
          Create the default map instance
protected  Class<? extends Map> getExpectedClass()
           
protected  org.jboss.reflect.spi.ClassInfo getKeyClassInfo(ClassLoader cl)
          Get the class info for the key type
 String getKeyType()
          Get the key 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.
protected  org.jboss.reflect.spi.ClassInfo getValueClassInfo(ClassLoader cl)
          Get the class info for the value type
 String getValueType()
          Get the value type
 boolean isEmpty()
           
 Set<MetaDataVisitorNode> keySet()
           
 MetaDataVisitorNode put(MetaDataVisitorNode key, MetaDataVisitorNode value)
           
 void putAll(Map<? extends MetaDataVisitorNode,? extends MetaDataVisitorNode> t)
           
 MetaDataVisitorNode remove(Object key)
           
 void setKeyType(String keyType)
          Set the key type
 void setValueType(String valueType)
          Set the value type
 int size()
           
 Collection<MetaDataVisitorNode> values()
           
 
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, toString
 
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.Map
equals, hashCode
 
Methods inherited from interface org.jboss.util.JBossInterface
toShortString
 

Field Detail

keyType

protected String keyType
The key type


valueType

protected String valueType
The value type

Constructor Detail

AbstractMapMetaData

public AbstractMapMetaData()
Create a new map value

Method Detail

getKeyType

public String getKeyType()
Get the key type

Returns:
the key type

setKeyType

public void setKeyType(String keyType)
Set the key type

Parameters:
keyType - the key type

getValueType

public String getValueType()
Get the value type

Returns:
the value type

setValueType

public void setValueType(String valueType)
Set the value type

Parameters:
valueType - the value 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

clear

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

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<MetaDataVisitorNode,MetaDataVisitorNode>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<MetaDataVisitorNode,MetaDataVisitorNode>

entrySet

public Set<Map.Entry<MetaDataVisitorNode,MetaDataVisitorNode>> entrySet()
Specified by:
entrySet in interface Map<MetaDataVisitorNode,MetaDataVisitorNode>

get

public MetaDataVisitorNode get(Object key)
Specified by:
get in interface Map<MetaDataVisitorNode,MetaDataVisitorNode>

isEmpty

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

keySet

public Set<MetaDataVisitorNode> keySet()
Specified by:
keySet in interface Map<MetaDataVisitorNode,MetaDataVisitorNode>

put

public MetaDataVisitorNode put(MetaDataVisitorNode key,
                               MetaDataVisitorNode value)
Specified by:
put in interface Map<MetaDataVisitorNode,MetaDataVisitorNode>

putAll

public void putAll(Map<? extends MetaDataVisitorNode,? extends MetaDataVisitorNode> t)
Specified by:
putAll in interface Map<MetaDataVisitorNode,MetaDataVisitorNode>

remove

public MetaDataVisitorNode remove(Object key)
Specified by:
remove in interface Map<MetaDataVisitorNode,MetaDataVisitorNode>

size

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

values

public Collection<MetaDataVisitorNode> values()
Specified by:
values in interface Map<MetaDataVisitorNode,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

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

getDefaultInstance

protected Object getDefaultInstance()
Create the default map instance

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

getExpectedClass

protected Class<? extends Map> getExpectedClass()

getKeyClassInfo

protected org.jboss.reflect.spi.ClassInfo getKeyClassInfo(ClassLoader cl)
                                                   throws Throwable
Get the class info for the key type

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

getValueClassInfo

protected org.jboss.reflect.spi.ClassInfo getValueClassInfo(ClassLoader cl)
                                                     throws Throwable
Get the class info for the value type

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

clone

public AbstractMapMetaData 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.