Package org.faktorips.codegen.dthelpers
Class MoneyHelper
java.lang.Object
org.faktorips.codegen.dthelpers.AbstractDatatypeHelper
org.faktorips.codegen.dthelpers.MoneyHelper
- All Implemented Interfaces:
BaseDatatypeHelper<JavaCodeFragment>,DatatypeHelper
-
Field Summary
Fields inherited from interface org.faktorips.codegen.DatatypeHelper
BIG_DECIMAL, BOOLEAN, DECIMAL, INTEGER, LONG, MONEY, PRIMITIVE_BOOLEAN, PRIMITIVE_INTEGER, STRING -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new helper.MoneyHelper(MoneyDatatype datatype) Constructs a new helper for the given money datatype. -
Method Summary
Modifier and TypeMethodDescriptionReturns the qualified Java class name the datatype represents.getRangeJavaClassName(boolean useTypesafeCollections) Returns the qualified Java class name of the range class of the datatype this is a helper for.newInstance(String value) Returns aJavaCodeFragmentwith sourcecode that creates an instance of the datatype's Java class with the given value.newInstanceFromExpression(String expression) Methode der Oberklasse wird ueberschrieben, weil bei diesem Datentyp valueOf-Methode selbst Null-Expression zurueckgeben kannnewRangeInstance(JavaCodeFragment lowerBoundExp, JavaCodeFragment upperBoundExp, JavaCodeFragment stepExp, JavaCodeFragment containsNullExp, boolean useTypesafeCollections) Returns aJavaCodeFragmentcontaining the source code to create a new instance of a type specific range.Returns"null".protected JavaCodeFragmentvalueOfExpression(String expression) This method is supposed to be overridden by subclasses.Methods inherited from class org.faktorips.codegen.dthelpers.AbstractDatatypeHelper
createCastExpression, getDatatype, getToStringExpression, newEnumValueSetInstance, newEnumValueSetInstance, newInstanceFromExpression, newSafeCopy, referenceOrSafeCopyIfNeccessary, setDatatypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.faktorips.codegen.DatatypeHelper
getValueSetJavaClassName, newValueInstance
-
Constructor Details
-
MoneyHelper
public MoneyHelper()Constructs a new helper. -
MoneyHelper
Constructs a new helper for the given money datatype.- Throws:
IllegalArgumentException- if datatype isnull.
-
-
Method Details
-
getJavaClassName
Description copied from interface:DatatypeHelperReturns the qualified Java class name the datatype represents. -
newInstance
Description copied from interface:DatatypeHelperReturns aJavaCodeFragmentwith sourcecode that creates an instance of the datatype's Java class with the given value. If the value is null the fragment's sourcecode is either the String "null" or the sourcecode to get an instance of the appropriate null object. -
valueOfExpression
Description copied from class:AbstractDatatypeHelperThis method is supposed to be overridden by subclasses.It is used within the
newInstanceFromExpression(String)method. It returns aJavaCodeFragmentwith sourcecode that creates an instance of the datatype's Java class with the given expression.If the expression is
nullthe fragment's sourcecode is either the String "null" or the sourcecode to get an instance of the appropriate null object. Preconditions: Expression may not be null or empty. When evaluated the expression must return a String.- Specified by:
valueOfExpressionin classAbstractDatatypeHelper
-
newInstanceFromExpression
Methode der Oberklasse wird ueberschrieben, weil bei diesem Datentyp valueOf-Methode selbst Null-Expression zurueckgeben kann- Specified by:
newInstanceFromExpressionin interfaceBaseDatatypeHelper<JavaCodeFragment>- Specified by:
newInstanceFromExpressionin interfaceDatatypeHelper- Overrides:
newInstanceFromExpressionin classAbstractDatatypeHelper- Parameters:
expression- A Java source code expression that yields a String. Examples are a constant String like"FOO", a variable likefooor a method call likegetÍd().
-
nullExpression
Description copied from class:AbstractDatatypeHelperReturns"null". Returns aJavaCodeFragmentwith sourcecode that is either the String "null" or the sourcecode to get an instance of the appropriate null object.- Specified by:
nullExpressionin interfaceBaseDatatypeHelper<JavaCodeFragment>- Specified by:
nullExpressionin interfaceDatatypeHelper- Overrides:
nullExpressionin classAbstractDatatypeHelper
-
getRangeJavaClassName
Description copied from interface:DatatypeHelperReturns the qualified Java class name of the range class of the datatype this is a helper for.- Specified by:
getRangeJavaClassNamein interfaceDatatypeHelper- Overrides:
getRangeJavaClassNamein classAbstractDatatypeHelper
-
newRangeInstance
public JavaCodeFragment newRangeInstance(JavaCodeFragment lowerBoundExp, JavaCodeFragment upperBoundExp, JavaCodeFragment stepExp, JavaCodeFragment containsNullExp, boolean useTypesafeCollections) Description copied from interface:DatatypeHelperReturns aJavaCodeFragmentcontaining the source code to create a new instance of a type specific range.- Specified by:
newRangeInstancein interfaceDatatypeHelper- Overrides:
newRangeInstancein classAbstractDatatypeHelper- Parameters:
lowerBoundExp- the lower bound expression of the range. Can benullto indicate that the lower bound is openupperBoundExp- the upper bound expression of the range. Can benullto indicate that the upper bound is open.stepExp- the minimum increment expression for values within the lower and upper bounds. Can benullto indicate that this is a continuous range.containsNullExp- the containsNull expression- Returns:
- the code fragment to create a new range instance. Can be null to indicate that a range is not supported.
-