ma.glasnost.orika.impl.generator
Class MultiOccurrenceVariableRef
java.lang.Object
ma.glasnost.orika.impl.generator.VariableRef
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
| Fields inherited from class ma.glasnost.orika.impl.generator.VariableRef |
name |
| 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 |
MultiOccurrenceVariableRef
public MultiOccurrenceVariableRef(Property property,
String name)
MultiOccurrenceVariableRef
public MultiOccurrenceVariableRef(Property property,
MultiOccurrenceVariableRef anchor)
MultiOccurrenceVariableRef
public MultiOccurrenceVariableRef(Type<?> type,
String name)
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.