Java EE 5 SDK

com.sun.appserv.management.base
Class MapCapableBase

java.lang.Object
  extended by com.sun.appserv.management.base.MapCapableBase
All Implemented Interfaces:
MapCapable
Direct Known Subclasses:
DeploymentProgressImpl, DeploymentSourceImpl, MessageTraceImpl, OperationStatusBase, WebServiceEndpointInfoImpl

public abstract class MapCapableBase
extends Object
implements MapCapable

Base impl class.


Field Summary
 
Fields inherited from interface com.sun.appserv.management.base.MapCapable
MAP_CAPABLE_CLASS_NAME_KEY
 
Constructor Summary
protected MapCapableBase(Map<String,T> m, String className)
           
protected MapCapableBase(String className)
           
 
Method Summary
 Map<String,Serializable> asMap()
          To be capable of being serialized and deserialized by generic clients, the following rules must be observed for the resulting Map.
protected  Serializable asMapHook(String key, Serializable value)
           
protected  void checkInJavaUtil(Object o)
           
protected  void checkLegalObject(Object o)
           
protected  void checkLegalObject(Object o, boolean allowMapCapable)
          We restrict the set of legal types to: OpenTypes Collection whose values meet these restrictions arrays whose values meet these restrictions Map whose keys and values meet these restrictions Throwable which are part of java or javax MapCapable whose Map meets these restrictions (assuming allowMapCapable is true)
protected
<T extends Serializable>
void
checkValidType(Map<String,T> m, String requiredType)
           
 boolean equals(Object o)
           
protected  boolean getboolean(String key)
           
protected  Boolean getBoolean(String key)
           
protected  Byte getByte(String key)
           
protected  Serializable getField(String key)
           
protected  File getFile(String key)
           
protected  Integer getInteger(String key)
           
protected  Map<String,Serializable> getMap(String key)
           
 String getMapClassName()
          Return the type name which will be paired with MAP_CAPABLE_CLASS_NAME_KEY.
protected  Serializable getObject(String key)
           
protected  String getString(String key)
           
protected  String[] getStringArray(String key)
           
 int hashCode()
           
protected  void illegalObject(Object o)
           
 void makeImmutable()
          Make this Object immutable.
protected
<T extends Serializable>
void
putAll(Map<String,T> m)
          Add fields one-by-one so we can check compliance with OpenTypes
 void putField(String key, Serializable value)
          Add a field to the object.
protected  Serializable putFieldHook(String key, Serializable value)
           
 String toString()
           
protected abstract  boolean validate()
          Return true if internal state is valid, false otherwise.
protected  boolean validateNullOrOfType(String key, Class<?> theClass)
           
protected  void validateThrow()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapCapableBase

protected MapCapableBase(String className)

MapCapableBase

protected MapCapableBase(Map<String,T> m,
                         String className)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

checkValidType

protected <T extends Serializable> void checkValidType(Map<String,T> m,
                                                       String requiredType)

validate

protected abstract boolean validate()
Return true if internal state is valid, false otherwise.


getMapClassName

public String getMapClassName()
Return the type name which will be paired with MAP_CAPABLE_CLASS_NAME_KEY.

Specified by:
getMapClassName in interface MapCapable

illegalObject

protected void illegalObject(Object o)

checkInJavaUtil

protected void checkInJavaUtil(Object o)

checkLegalObject

protected final void checkLegalObject(Object o,
                                      boolean allowMapCapable)
We restrict the set of legal types to:


checkLegalObject

protected final void checkLegalObject(Object o)

validateNullOrOfType

protected boolean validateNullOrOfType(String key,
                                       Class<?> theClass)

validateThrow

protected final void validateThrow()

asMapHook

protected Serializable asMapHook(String key,
                                 Serializable value)

asMap

public final Map<String,Serializable> asMap()
Description copied from interface: MapCapable
To be capable of being serialized and deserialized by generic clients, the following rules must be observed for the resulting Map.

The Map itself and any items it references, directly or indirectly must be of a class of one of the following:

Specified by:
asMap in interface MapCapable
Returns:
an equivalent Map representing the original object.

makeImmutable

public void makeImmutable()
Make this Object immutable.


putField

public void putField(String key,
                     Serializable value)
Add a field to the object. The Object can choose to reject addition of the field.


putFieldHook

protected Serializable putFieldHook(String key,
                                    Serializable value)

putAll

protected <T extends Serializable> void putAll(Map<String,T> m)
Add fields one-by-one so we can check compliance with OpenTypes


getField

protected Serializable getField(String key)

getObject

protected final Serializable getObject(String key)

getString

protected final String getString(String key)

getStringArray

protected final String[] getStringArray(String key)

getBoolean

protected final Boolean getBoolean(String key)

getByte

protected final Byte getByte(String key)

getboolean

protected final boolean getboolean(String key)

getInteger

protected final Integer getInteger(String key)

getMap

protected final Map<String,Serializable> getMap(String key)

getFile

protected final File getFile(String key)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.