net.vidageek.mirror.dsl
Class Mirror

java.lang.Object
  extended by net.vidageek.mirror.dsl.Mirror

public final class Mirror
extends Object

This is the basic class to use Mirror. All Reflection features can be accessed using this class. It will load configuration file [mirror.properties]. Full Mirror configuration is found at http://projetos.vidageek.net/mirror/extension/configuration/ *

Author:
jonasabreu

Constructor Summary
Mirror()
           
Mirror(ReflectionProvider provider)
           
 
Method Summary
 MemberController on(AnnotatedElement member)
          Method to access reflection on any AnnotatedElement
<T> ClassController<T>
on(Class<T> clazz)
          Method to access reflection on clazz.
 FieldController on(Field field)
          Method to access reflection on any Field.
 AccessorsController on(Object object)
          Method to access reflection on object.
 ClassController<?> on(String className)
          Convenience method for on(Class).
 ProxyHandler<Object> proxify(Class<?>... classes)
          Method to create proxys of classes.
<T> ProxyHandler<T>
proxify(Class<T> clazz)
          Convenience method for proxify(Class...)
 ProxyHandler<Object> proxify(String... classNames)
          Convenience method for proxify(Class...)
 ProxyHandler<Object> proxify(String className)
          Convenience method for proxify(Class...)
 Class<?> reflectClass(String className)
          This method will reflect a Class object that is represented by className.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mirror

public Mirror(ReflectionProvider provider)

Mirror

public Mirror()
Method Detail

reflectClass

public Class<?> reflectClass(String className)
This method will reflect a Class object that is represented by className.

Parameters:
className - Full qualified name of the class you want to reflect.
Returns:
A Class object represented by className.
Throws:
MirrorException - if no class on current ClassLoader has class represented by className.
IllegalArgumentException - if className is null or empty.

on

public <T> ClassController<T> on(Class<T> clazz)
Method to access reflection on clazz.

Parameters:
clazz - Class object to be used.
Returns:
A object that allows you to access reflection on class clazz.
Throws:
IllegalArgumentException - if clazz is null.

on

public AccessorsController on(Object object)
Method to access reflection on object.

Parameters:
object - Object to be used.
Returns:
A object that allows you to access reflection on object.
Throws:
IllegalArgumentException - if object is null.

on

public ClassController<?> on(String className)
Convenience method for on(Class).

See Also:
on(Class), reflectClass(String)

on

public MemberController on(AnnotatedElement member)
Method to access reflection on any AnnotatedElement

Parameters:
object - AccessibleObject to be used.
Returns:
An object that allows you to access reflection on an AccessibleObject.
See Also:
AccessibleObject

on

public FieldController on(Field field)
Method to access reflection on any Field.

Parameters:
field - to be used
Returns:
An object that allows you to access reflection on a Field.
Throws:
IllegalArgumentException - if field is null.

proxify

public <T> ProxyHandler<T> proxify(Class<T> clazz)
Convenience method for proxify(Class...)

See Also:
Mirror#on(Class)}, Mirror#proxify(Class...)}

proxify

public ProxyHandler<Object> proxify(String className)
Convenience method for proxify(Class...)

See Also:
Mirror#on(Class)}, Mirror#proxify(Class...)}

proxify

public ProxyHandler<Object> proxify(String... classNames)
Convenience method for proxify(Class...)

See Also:
Mirror#on(Class)}, Mirror#proxify(Class...)}, Mirror#reflectClass(String)}

proxify

public ProxyHandler<Object> proxify(Class<?>... classes)
Method to create proxys of classes. There can be only one actual class. All the remaining "classes" must be interfaces.

Parameters:
classes - to be proxified
Returns:
An object responsible for setting method interceptors
Throws:
IllegalArgumentException - if any class is null or there is more than one class that is not an interface


Copyright © 2011 VidaGeek.net. All Rights Reserved.