fr.etai.xat2v2.obj
Class Xat2Property<T>

java.lang.Object
  extended by fr.etai.xat2v2.obj.Xat2Property<T>
Type Parameters:
T -
All Implemented Interfaces:
Comparable<Xat2Property<T>>

public final class Xat2Property<T>
extends Object
implements Comparable<Xat2Property<T>>

Useful class r=that can extract meta informations about properties of xat2 objects.

Author:
rlecomte

Nested Class Summary
static class Xat2Property.PropertyType
           
 
Method Summary
 Object addElement(T object)
           
 int compareTo(Xat2Property<T> o)
           
static
<T> Xat2Property<T>[]
extract(Class<T> cl)
           
 Method getAddMethod()
           
 Field getField()
           
 Method getGetter()
           
static String getInternalId(Object object)
          Gets the internal id of the object, or null if there's none.
 String getPropertyName()
           
 Class<?> getPropertyType()
           
 Method getSetter()
           
 Xat2Property.PropertyType getType()
           
 Object getValue(Object object)
           
static boolean hasInternalId(Object object)
          Checks if the object has a not null internal id
 Object initProperty(T object)
           
 boolean isEnum()
           
 boolean isIDRef()
          Checks if the property is a link to another Xat2 Object (ie if the property has a XmlIDREF annotation).
 boolean isInternalId()
          Checks is the property is an XML internal identifier (ie if the property as a XmlID annotation).
 boolean isSet(T object)
           
static boolean isXat2Class(Class<?> cl)
           
static boolean isXat2Object(Object object)
           
static void removeIDs(Object object)
           
 void setValue(T object, Object value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAddMethod

public Method getAddMethod()

extract

public static <T> Xat2Property<T>[] extract(Class<T> cl)

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Xat2Property<T> o)
Specified by:
compareTo in interface Comparable<Xat2Property<T>>

initProperty

public Object initProperty(T object)

setValue

public void setValue(T object,
                     Object value)

addElement

public Object addElement(T object)

isSet

public boolean isSet(T object)

getValue

public Object getValue(Object object)

getPropertyType

public Class<?> getPropertyType()

getPropertyName

public String getPropertyName()

getGetter

public Method getGetter()

getSetter

public Method getSetter()

getType

public Xat2Property.PropertyType getType()

getField

public Field getField()

isInternalId

public boolean isInternalId()
Checks is the property is an XML internal identifier (ie if the property as a XmlID annotation).

Returns:

isEnum

public boolean isEnum()

hasInternalId

public static boolean hasInternalId(Object object)
Checks if the object has a not null internal id

Parameters:
object -
Returns:

getInternalId

public static String getInternalId(Object object)
Gets the internal id of the object, or null if there's none.

Parameters:
object -
Returns:

isIDRef

public boolean isIDRef()
Checks if the property is a link to another Xat2 Object (ie if the property has a XmlIDREF annotation).

Returns:

removeIDs

public static void removeIDs(Object object)

isXat2Object

public static boolean isXat2Object(Object object)

isXat2Class

public static boolean isXat2Class(Class<?> cl)


Copyright © 2012. All Rights Reserved.