org.andromda.core.common
Class Introspector

java.lang.Object
  extended by org.andromda.core.common.Introspector

public final class Introspector
extends java.lang.Object

A simple class providing the ability to manipulate properties on java bean objects.

Author:
Chad Brandon

Constructor Summary
Introspector()
           
 
Method Summary
 boolean containsValidProperty(java.lang.Object object, java.lang.String name, java.lang.String value)
           Indicates whether or not the given object contains a valid property with the given name and value.
 java.lang.Object getProperty(java.lang.Object object, java.lang.String name)
          Attempts to retrieve the property with the given name on the object.
static Introspector instance()
          Gets the shared instance.
 boolean isReadable(java.lang.Object object, java.lang.String name)
          Indicates if the object has a property that is readable with the given name.
 boolean isWritable(java.lang.Object object, java.lang.String name)
          Indicates if the object has a property that is writable with the given name.
 void setProperty(java.lang.Object object, java.lang.String name, java.lang.Object value)
          Sets the property having the given name on the object with the given value.
 void shutdown()
          Shuts this instance down and reclaims any resouces used by this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Introspector

public Introspector()
Method Detail

instance

public static Introspector instance()
Gets the shared instance.

Returns:
the shared introspector instance.

containsValidProperty

public boolean containsValidProperty(java.lang.Object object,
                                     java.lang.String name,
                                     java.lang.String value)

Indicates whether or not the given object contains a valid property with the given name and value.

A valid property means the following:

All other possibilities return false

Parameters:
object - the object to test for the valid property.
name - the name of the propery for which to test.
value - the value to evaluate against.
Returns:
true/false

setProperty

public void setProperty(java.lang.Object object,
                        java.lang.String name,
                        java.lang.Object value)
Sets the property having the given name on the object with the given value.

Parameters:
object - the object on which to set the property.
name - the name of the property to populate.
value - the value to give the property.

getProperty

public final java.lang.Object getProperty(java.lang.Object object,
                                          java.lang.String name)
Attempts to retrieve the property with the given name on the object.

Parameters:
object - the object to which the property belongs.
name - the name of the property
Returns:
the value of the property.

isReadable

public boolean isReadable(java.lang.Object object,
                          java.lang.String name)
Indicates if the object has a property that is readable with the given name.

Parameters:
object - the object to check.
name - the property to check for.

isWritable

public boolean isWritable(java.lang.Object object,
                          java.lang.String name)
Indicates if the object has a property that is writable with the given name.

Parameters:
object - the object to check.
name - the property to check for.

shutdown

public void shutdown()
Shuts this instance down and reclaims any resouces used by this instance.



Copyright © 2003-2008 AndroMDA.org. All Rights Reserved.