org.filteredpush.rdf.reflection
Class ClassMembers

java.lang.Object
  extended by org.filteredpush.rdf.reflection.ClassMembers

public class ClassMembers
extends java.lang.Object

Represents the members of a given class as java reflection objects for fields and methods.

Author:
dlowery

Constructor Summary
ClassMembers(java.lang.Class<?> clazz)
          Constructor takes a class as an argument and creates the representation of the methods and fields.
 
Method Summary
 java.util.Set<java.lang.Class<?>> getAssociatedClasses()
          Get a set of all the associated classes.
 java.util.Set<java.lang.reflect.AccessibleObject> getClassAccessibleObj(java.lang.Class<?> clazz)
          Get the accessible object for a given class (the argument clazz).
 java.lang.reflect.AccessibleObject getField(java.lang.String name)
          Gets a public field or its access method as a java reflection object.
 java.lang.reflect.Method getMethod(java.lang.String name)
          Obtain a method by name as a java reflection object.
 boolean hasA(java.lang.Class<?> clazz)
          Checks to see if the class given as an argument is associated with the current one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassMembers

public ClassMembers(java.lang.Class<?> clazz)
             throws java.io.IOException,
                    java.lang.ClassNotFoundException
Constructor takes a class as an argument and creates the representation of the methods and fields.

Parameters:
clazz -
Throws:
java.io.IOException
java.lang.ClassNotFoundException
Method Detail

hasA

public boolean hasA(java.lang.Class<?> clazz)
Checks to see if the class given as an argument is associated with the current one.

Parameters:
clazz -
Returns:
boolean

getAssociatedClasses

public java.util.Set<java.lang.Class<?>> getAssociatedClasses()
Get a set of all the associated classes.

Returns:
set of Class

getField

public java.lang.reflect.AccessibleObject getField(java.lang.String name)
Gets a public field or its access method as a java reflection object.

Parameters:
name - the name of the field
Returns:
an accessible object

getMethod

public java.lang.reflect.Method getMethod(java.lang.String name)
Obtain a method by name as a java reflection object.

Parameters:
name -
Returns:
reflection method object

getClassAccessibleObj

public java.util.Set<java.lang.reflect.AccessibleObject> getClassAccessibleObj(java.lang.Class<?> clazz)
Get the accessible object for a given class (the argument clazz). For example, if the current class has field that is a Set containing instances of clazz this method would return it.

Parameters:
clazz -
Returns:
the accessible object