com.openpojo.reflection
Interface PojoClass

Package class diagram package PojoClass
All Superinterfaces:
Annotatable, PojoElement
All Known Implementing Classes:
PojoClassImpl

public interface PojoClass
extends PojoElement

This Interface defines the contract published by PojoClass implementations. The idea is to give an easy and flexible way to work with application POJO classes.

Author:
oshoukry

Method Summary
 void copy(java.lang.Object from, java.lang.Object to)
          Copy all contents from one Instance represented by this PojoClass to another.
 boolean extendz(java.lang.Class<?> type)
          Checks to see if class extends/implements a certain type.
 java.lang.Class<?> getClazz()
          This method returns the underlying class represented by this instance.
 java.util.List<PojoClass> getInterfaces()
          Returns a list of all interfaces implemented by the class represented by this PojoClass.
 java.util.List<PojoMethod> getPojoConstructors()
          Get all Constructors defined in the class.
 java.util.List<PojoField> getPojoFields()
          Get all PojoFields defined in the class.
 java.util.List<PojoField> getPojoFieldsAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
          Get all PojoFields annotated with given annotation.
 java.util.List<PojoMethod> getPojoMethods()
          Get all PojoMethods defined in the class;
 java.util.List<PojoMethod> getPojoMethodsAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
          Get all PojoMethods annotated with given annotation
 java.lang.String getSourcePath()
          This method returns the location from which this class was loaded.
 PojoClass getSuperClass()
          Return the super class of the class represented by this PojoClass class.
 boolean isAbstract()
          Check if PojoClass wraps an abstract.
 boolean isArray()
          Check if PojoClass wraps an array.
 boolean isConcrete()
          Check if PojoClass wraps a concrete (i.e.
 boolean isEnum()
          Check if PojoClass wraps an enum.
 boolean isFinal()
          Check if PojoClass wraps a final class.
 boolean isInterface()
          Check if PojoClass wraps an interface.
 boolean isNestedClass()
          Checks to see if this class is a nested subclass.
 boolean isStatic()
          Check if PojoClass wraps a static class.
 boolean isSynthetic()
           
 java.lang.String toString(java.lang.Object instance)
          This method converts a pojoClass instance's contents to a string.
 
Methods inherited from interface com.openpojo.reflection.PojoElement
getName
 
Methods inherited from interface com.openpojo.reflection.Annotatable
getAnnotation, getAnnotations
 

Method Detail

isInterface

boolean isInterface()
Check if PojoClass wraps an interface.

Returns:
true if this PojoClass wraps an interface.

isAbstract

boolean isAbstract()
Check if PojoClass wraps an abstract.

Returns:
true if this PojoClass wraps an abstract class.

isConcrete

boolean isConcrete()
Check if PojoClass wraps a concrete (i.e. can be instantiated).

Returns:
true if this PojoClass wraps a concrete class.

isEnum

boolean isEnum()
Check if PojoClass wraps an enum.

Returns:
true if this PojoClass wraps an enum type.

isArray

boolean isArray()
Check if PojoClass wraps an array.

Returns:
true if this PojoClass wraps an array class.

isFinal

boolean isFinal()
Check if PojoClass wraps a final class.

Returns:
true if this PojoClass wraps a final class.

isSynthetic

boolean isSynthetic()
Returns:
true if this PojoField is synthetic (i.e. jdk compiler generated).

getPojoFields

java.util.List<PojoField> getPojoFields()
Get all PojoFields defined in the class.

Returns:
the pojoFields

getPojoFieldsAnnotatedWith

java.util.List<PojoField> getPojoFieldsAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Get all PojoFields annotated with given annotation.


getPojoMethods

java.util.List<PojoMethod> getPojoMethods()
Get all PojoMethods defined in the class;


getPojoMethodsAnnotatedWith

java.util.List<PojoMethod> getPojoMethodsAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Get all PojoMethods annotated with given annotation


getPojoConstructors

java.util.List<PojoMethod> getPojoConstructors()
Get all Constructors defined in the class.


extendz

boolean extendz(java.lang.Class<?> type)
Checks to see if class extends/implements a certain type.

Parameters:
type - The type in question.
Returns:
True if class is subclass or implements an interface, otherwise false.

getSuperClass

PojoClass getSuperClass()
Return the super class of the class represented by this PojoClass class.

Returns:
PojoClass representing the super class of this class or null if none exist.

getInterfaces

java.util.List<PojoClass> getInterfaces()
Returns a list of all interfaces implemented by the class represented by this PojoClass.

Returns:
The list of interfaces implemented by the class wrapped by this PojoClass.

getClazz

java.lang.Class<?> getClazz()
This method returns the underlying class represented by this instance.

Returns:
The class type wrapped by this PojoClass.

isNestedClass

boolean isNestedClass()
Checks to see if this class is a nested subclass.

Returns:
True if it is a subclass, false otherwise.

isStatic

boolean isStatic()
Check if PojoClass wraps a static class. This would be true for example when a class is defined as nested and is declared static.

Returns:
true if this PojoClass wraps a static class.

copy

void copy(java.lang.Object from,
          java.lang.Object to)
Copy all contents from one Instance represented by this PojoClass to another.

Parameters:
from - The Instance to copy from.
to - The Instance to copy to.

toString

java.lang.String toString(java.lang.Object instance)
This method converts a pojoClass instance's contents to a string. This method can serve as a good delegate for all toString().

Parameters:
instance - The instance to print the contents out of.
Returns:
String representation of the instance.

getSourcePath

java.lang.String getSourcePath()
This method returns the location from which this class was loaded. Note: Do not use, still in experimental mode.

Returns:
String of the PATH of where this class was loaded from.


Copyright © 2010-2015. All Rights Reserved.