ma.glasnost.orika.metadata
Class Property.Builder

java.lang.Object
  extended by ma.glasnost.orika.metadata.Property.Builder
Enclosing class:
Property

public static class Property.Builder
extends Object

Builder is used to construct immutable Property instances


Constructor Summary
Property.Builder()
          Creates a new Property.Builder
Property.Builder(Type<?> owningType, String name)
          Creates a new Property.Builder for the specified owning type and property name
 
Method Summary
 Property build()
          Builds the property
 Property build(PropertyResolver propertyResolver)
          Builds the property, using the specified proeprtyResolver to validate the property settings
 Property.Builder container(Property container)
           
 Property.Builder elementType(Type<?> elementType)
          Set the element type
 Property.Builder expression(String expression)
          Sets the expression
 Method getReadMethod()
          Get the getter/accessor method
 Property.Builder getter(Method readMethod)
          Set the getter/accessor method
 Property.Builder getter(String getter)
           
 Method getWriteMethod()
          Get the setter/mutator method
 Property.Builder merge(Property property)
          Merges the attributes of the specified property into this one
 Property.Builder name(String name)
          Set the name
 Property.Builder nestedProperty(String name)
          Creates a new nested property builder (with this builder as the owner) for the specified name
protected  Property.Builder owningType(Type<?> owningType)
          Sets the owning type
 Property.Builder path(Property[] path)
           
static Property.Builder propertyFor(Class<?> owningType, String name)
          Creates a new property builder for the specified owningType and name
static Property.Builder propertyFor(String owningTypeDescriptor, String name)
          Creates a new property builder for the specified owningType descriptor and name
static Property.Builder propertyFor(Type<?> owningType, String name)
          Creates a new property builder for the specified owningType and name
 Property.Builder setter(Method writeMethod)
          Set the setter/mutator method
 Property.Builder setter(String setter)
           
 String toString()
           
 Property.Builder type(String typeName)
          Set the type by name
 Property.Builder type(Type type)
          Set the type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Property.Builder

public Property.Builder(Type<?> owningType,
                        String name)
Creates a new Property.Builder for the specified owning type and property name

Parameters:
owningType -
name -

Property.Builder

public Property.Builder()
Creates a new Property.Builder

Method Detail

toString

public String toString()
Overrides:
toString in class Object

merge

public Property.Builder merge(Property property)
Merges the attributes of the specified property into this one

Parameters:
property -
Returns:

propertyFor

public static Property.Builder propertyFor(Type<?> owningType,
                                           String name)
Creates a new property builder for the specified owningType and name

Parameters:
owningType - the owning type
name - the new property's name
Returns:

propertyFor

public static Property.Builder propertyFor(Class<?> owningType,
                                           String name)
Creates a new property builder for the specified owningType and name

Parameters:
owningType - the owning type
name - the new property's name
Returns:

propertyFor

public static Property.Builder propertyFor(String owningTypeDescriptor,
                                           String name)
Creates a new property builder for the specified owningType descriptor and name

Parameters:
owningTypeDescriptor - a type-descriptor string describing the owning type
name - the new property's name
Returns:

nestedProperty

public Property.Builder nestedProperty(String name)
Creates a new nested property builder (with this builder as the owner) for the specified name

Parameters:
name -
Returns:

container

public Property.Builder container(Property container)
Parameters:
container - the container to set

path

public Property.Builder path(Property[] path)
Parameters:
path - the path to set
Returns:

getter

public Property.Builder getter(String getter)
Parameters:
getter - the getter to set

setter

public Property.Builder setter(String setter)
Parameters:
setter - the setter to set

expression

public Property.Builder expression(String expression)
Sets the expression

Parameters:
expression -
Returns:

name

public Property.Builder name(String name)
Set the name

Parameters:
name -
Returns:

type

public Property.Builder type(Type type)
Set the type

Parameters:
type -
Returns:

type

public Property.Builder type(String typeName)
Set the type by name

Parameters:
typeName -
Returns:

elementType

public Property.Builder elementType(Type<?> elementType)
Set the element type

Parameters:
elementType -
Returns:

getter

public Property.Builder getter(Method readMethod)
Set the getter/accessor method

Parameters:
readMethod -
Returns:

getReadMethod

public Method getReadMethod()
Get the getter/accessor method

Returns:
the readMethod

getWriteMethod

public Method getWriteMethod()
Get the setter/mutator method

Returns:
the writeMethod

setter

public Property.Builder setter(Method writeMethod)
Set the setter/mutator method

Parameters:
writeMethod -
Returns:

owningType

protected Property.Builder owningType(Type<?> owningType)
Sets the owning type

Parameters:
owningType -
Returns:

build

public Property build()
Builds the property

Returns:
the property specified by this builder

build

public Property build(PropertyResolver propertyResolver)
Builds the property, using the specified proeprtyResolver to validate the property settings

Parameters:
propertyResolver -
Returns:


Copyright © 2013 Glasnost. All Rights Reserved.