it.avutils.jmapper.operations
Class AGeneralOperation

java.lang.Object
  extended by it.avutils.jmapper.operations.AGeneralOperationAccessor
      extended by it.avutils.jmapper.operations.AGeneralOperation
Direct Known Subclasses:
AComplexOperation, ASimpleOperation

public abstract class AGeneralOperation
extends AGeneralOperationAccessor

This abstract class represents an abstract operation that adds, to basic mapping, a mapping type control.

Author:
Alessandro Vurro

Field Summary
 
Fields inherited from class it.avutils.jmapper.operations.AGeneralOperationAccessor
conversion, conversionMembership, destinationField, info, initialDGetPath, initialDSetPath, initialSGetPath, mtd, mts, sourceField
 
Constructor Summary
AGeneralOperation()
           
 
Method Summary
protected  StringBuilder addMappingTypeControl(StringBuilder content)
          this method adds a mapping type control to the basic mapping.
protected  StringBuilder applyExplicitConversion()
           
protected  Object applyImplicitConversion(ConversionType conversionType, Class<?> dClass, Class<?> sClass, Object sourceContent)
          This method returns the source content modified, analyzing conversion type, destination and source classes.
protected  StringBuilder getDestination()
           
protected  StringBuilder getSource()
           
protected  StringBuilder setDestination()
           
protected  StringBuilder setDestination(Object content)
          Returns a StringBuilder that contains setDestination(content); operation.
protected  boolean theSourceIsToBeConverted()
          Returns true if the source is to be converted, false otherwise
protected  StringBuilder write(Object... objects)
          This method adds to the new StringBuilder the objects.
protected  StringBuilder write(StringBuilder sb, Object... objects)
          This method adds to the sb the objects.
 
Methods inherited from class it.avutils.jmapper.operations.AGeneralOperationAccessor
destinationType, getMtd, getMts, initialDGetPath, initialDSetPath, initialSGetPath, setConversionMethod, setDestinationField, setInfoOperation, setMemberShip, setMtd, setMts, setSourceField, sourceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AGeneralOperation

public AGeneralOperation()
Method Detail

setDestination

protected final StringBuilder setDestination()
Returns:
a StringBuilder calculated at runtime representing the complete set destination path.
for example: destination.setField;

setDestination

protected final StringBuilder setDestination(Object content)
Returns a StringBuilder that contains setDestination(content); operation.

Parameters:
content - content to set
Returns:
a StringBuilder with setDestination(content); operation

getDestination

protected final StringBuilder getDestination()
Returns:
a StringBuilder calculated at runtime representing the complete get destination path.
for example: destination.getField()

getSource

protected final StringBuilder getSource()
Returns:
a StringBuilder calculated at runtime representing the complete get source path.
for example: source.getField()

addMappingTypeControl

protected final StringBuilder addMappingTypeControl(StringBuilder content)
this method adds a mapping type control to the basic mapping.

Parameters:
content - mapping that will be wrapped with mappingType control
Returns:
a String that contains a single operation

applyExplicitConversion

protected final StringBuilder applyExplicitConversion()
Returns:
a StringBuilder calculated at runtime representing the explicit conversion.

applyImplicitConversion

protected final Object applyImplicitConversion(ConversionType conversionType,
                                               Class<?> dClass,
                                               Class<?> sClass,
                                               Object sourceContent)
This method returns the source content modified, analyzing conversion type, destination and source classes.

Parameters:
conversionType - type of conversion
dClass - destination Class
sClass - source Class
sourceContent - content of source
Returns:
a string that containts literal conversion

theSourceIsToBeConverted

protected boolean theSourceIsToBeConverted()
Returns true if the source is to be converted, false otherwise

Returns:
true if the source is to be converted, false otherwise

write

protected final StringBuilder write(Object... objects)
This method adds to the new StringBuilder the objects.

Parameters:
objects - objects to be added to a StringBuilder
Returns:
the StringBuilder created

write

protected final StringBuilder write(StringBuilder sb,
                                    Object... objects)
This method adds to the sb the objects.

Parameters:
sb - StringBuilder to be used
objects - objects to be added to sb
Returns:
the sb parameter


Copyright © 2013. All Rights Reserved.