ma.glasnost.orika.metadata
Class Property
java.lang.Object
ma.glasnost.orika.metadata.Property
- Direct Known Subclasses:
- ArrayElementProperty, ListElementProperty, MapKeyProperty, NestedElementProperty, NestedProperty
public class Property
- extends Object
Property is an immutable representation of an accessor/mutator pair (either
of which may be null) that is used to generate code needed to copy data from
one type to another.
|
Nested Class Summary |
static class |
Property.Builder
Builder is used to construct immutable Property instances |
Property
protected Property(String expression,
String name,
String getter,
String setter,
Type<?> type,
Type<?> elementType,
Property container)
- Constructs a new Property instance
- Parameters:
expression - name - getter - setter - type - elementType - container -
copy
public Property copy()
- Returns:
- a copy of this property instance
copy
public Property copy(Type<?> newType)
- Parameters:
newType -
- Returns:
- a copy of this property with the new type as it's type
getExpression
public String getExpression()
- Returns:
- the expression describing this property
getName
public String getName()
- Returns:
- the name of this property
getType
public Type<?> getType()
- Returns:
- the type of this property
getGetter
public String getGetter()
- Returns:
- the string description of the accessor for this property
getSetter
public String getSetter()
- Returns:
- the string description of the mutator for this property
getSetterName
public String getSetterName()
- Returns:
- the name of the setter method for this property
getGetterName
public String getGetterName()
- Returns:
- the name of the getter method for this property
getElementType
public Type<?> getElementType()
- Returns:
- the element type for this property
getRawType
public Class<?> getRawType()
- Returns:
- the raw type of this property
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
isPrimitive
public boolean isPrimitive()
- Returns:
- true if this property's type is primitive
isArray
public boolean isArray()
- Returns:
- tre if this property's type is an array
isAssignableFrom
public boolean isAssignableFrom(Property p)
- Parameters:
p -
- Returns:
- true if this property is assignable from the other property p
isCollection
public boolean isCollection()
- Returns:
- true if this property's type is a Collection
isSet
public boolean isSet()
- Returns:
- true if this property's type is a Set
isList
public boolean isList()
- Returns:
- true if this property's type is a List
isMap
public boolean isMap()
- Returns:
- true if this property's type is a Map
isMapKey
public boolean isMapKey()
- Returns:
- true if this property represents a Map Key
isListElement
public boolean isListElement()
- Returns:
- true if this property represents a list element
isArrayElement
public boolean isArrayElement()
- Returns:
- true if this property represents an array element
isMultiOccurrence
public boolean isMultiOccurrence()
- Returns:
- true if this property is a Map, Collection or Array
hasPath
public boolean hasPath()
- Returns:
- true if this property has a path
getPath
public Property[] getPath()
- Returns:
- the path to this property; properties in the path are ordered
from parent to child
getContainer
public Property getContainer()
- Returns:
- the container for this property; null unless the property
represents an element of a multi-occurrence property
getElement
public Property getElement()
- Returns:
- the element property
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
toString
public String toString()
- Overrides:
toString in class Object
isEnum
public boolean isEnum()
- Returns:
- true if this property is an enum
Copyright © 2013 Glasnost. All Rights Reserved.