ma.glasnost.orika.impl.generator
Class MultiOccurrenceVariableRef

java.lang.Object
  extended by ma.glasnost.orika.impl.generator.VariableRef
      extended by ma.glasnost.orika.impl.generator.MultiOccurrenceVariableRef
Direct Known Subclasses:
MultiOccurrenceVariableRef.EntrySetRef

public class MultiOccurrenceVariableRef
extends VariableRef

VariableRef represents a reference to a given variable or property; it contains various helper methods to properly set it's value and interrogate it's underlying property or type. It also returns a properly type-safe cast of it as the toString() method, so it can safely be used directly as a replacement parameter for source code statements.

Author:
matt.deboer@gmail.com

Nested Class Summary
static class MultiOccurrenceVariableRef.EntrySetRef
           
 
Field Summary
 
Fields inherited from class ma.glasnost.orika.impl.generator.VariableRef
name
 
Constructor Summary
MultiOccurrenceVariableRef(Property property, MultiOccurrenceVariableRef anchor)
           
MultiOccurrenceVariableRef(Property property, String name)
           
MultiOccurrenceVariableRef(Type<?> type, String name)
           
 
Method Summary
 String add(String value)
           
 String add(VariableRef value)
           
 String addAll(VariableRef value)
          A convenience function for adding all of one multi-occurrence type to another
 String collectionType()
           
 String declareIterator()
           
 String declareIteratorIfNotDeclared()
           
static MultiOccurrenceVariableRef from(VariableRef r)
          up-converts the specified standard VariableRef into a MultiOccurrenceVariableRef
 String iteratorHasNext()
           
 String newCollection()
           
 String newInstance(String sizeExpr)
           
 String newMap()
           
 String newMap(String sizeExpr)
           
 String nextElement()
           
 String notEmpty()
           
 String size()
          Generates java code for a reference to the "size" of this VariableRef
 
Methods inherited from class ma.glasnost.orika.impl.generator.VariableRef
assertType, assign, assign, assignIfPossible, assignIfPossible, asWrapper, cast, cast, cast, cast, declare, declare, declare, elementRef, elementType, elementTypeName, elementValueType, equals, getConverter, getDefaultValue, getGetter, getOwner, getPath, getSetter, getter, hashCode, ifNotNull, ifNull, ifPathNotNull, isArray, isAssignable, isCollection, isDeclared, isInstanceOf, isList, isMap, isMapEntry, isNestedProperty, isNull, isPrimitive, isPrimitiveLiteral, isReadable, isSet, isWrapper, mapKeyType, mapValueType, name, notNull, owner, primitiveType, primitiveType, property, rawType, setConverter, setOwner, setter, toString, type, typeName, wrapperTypeName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiOccurrenceVariableRef

public MultiOccurrenceVariableRef(Property property,
                                  String name)

MultiOccurrenceVariableRef

public MultiOccurrenceVariableRef(Property property,
                                  MultiOccurrenceVariableRef anchor)

MultiOccurrenceVariableRef

public MultiOccurrenceVariableRef(Type<?> type,
                                  String name)
Method Detail

from

public static MultiOccurrenceVariableRef from(VariableRef r)
up-converts the specified standard VariableRef into a MultiOccurrenceVariableRef

Parameters:
r -
Returns:

declareIteratorIfNotDeclared

public String declareIteratorIfNotDeclared()

declareIterator

public String declareIterator()

nextElement

public String nextElement()

iteratorHasNext

public String iteratorHasNext()

notEmpty

public String notEmpty()

addAll

public String addAll(VariableRef value)
A convenience function for adding all of one multi-occurrence type to another

Parameters:
value -
Returns:

add

public String add(VariableRef value)

add

public String add(String value)

collectionType

public String collectionType()

newCollection

public String newCollection()

newInstance

public String newInstance(String sizeExpr)

newMap

public String newMap(String sizeExpr)

newMap

public String newMap()

size

public String size()
Generates java code for a reference to the "size" of this VariableRef

Overrides:
size in class VariableRef
Returns:


Copyright © 2013 Glasnost. All Rights Reserved.