Package org.faktorips.codegen.dthelpers
Class PrimitiveIntegerHelper
java.lang.Object
org.faktorips.codegen.dthelpers.AbstractDatatypeHelper
org.faktorips.codegen.dthelpers.AbstractPrimitiveDatatypeHelper
org.faktorips.codegen.dthelpers.PrimitiveIntegerHelper
- All Implemented Interfaces:
BaseDatatypeHelper<JavaCodeFragment>,DatatypeHelper,PrimitiveDatatypeHelper
-
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.Constructs a new helper for the given primitive integer datatype. -
Method Summary
Modifier and TypeMethodDescriptionReturns the qualified Java class name the datatype represents.Retrieves theDatatypeHelperfor the wrapper type of the primitive type for which this helper is responsible.newInstance(String value) Returns aJavaCodeFragmentwith sourcecode that creates an instance of the datatype's Java class with the given value.toWrapper(JavaCodeFragment expression) Given a JavaCodeFragment containing an expression of the primitive type this is a helper for, returns a JavaCodeFragment that converts the given expression to the appropriate wrapper class.protected JavaCodeFragmentvalueOfExpression(String expression) This method is supposed to be overridden by subclasses.Methods inherited from class org.faktorips.codegen.dthelpers.AbstractPrimitiveDatatypeHelper
getToStringExpression, newEnumValueSetInstance, newEnumValueSetInstance, newInstanceFromExpression, nullExpressionMethods inherited from class org.faktorips.codegen.dthelpers.AbstractDatatypeHelper
createCastExpression, getDatatype, getRangeJavaClassName, newEnumValueSetInstance, newEnumValueSetInstance, newInstanceFromExpression, newRangeInstance, 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
createCastExpression, getDatatype, getRangeJavaClassName, getValueSetJavaClassName, newEnumValueSetInstance, newEnumValueSetInstance, newInstanceFromExpression, newRangeInstance, newValueInstance, referenceOrSafeCopyIfNeccessary, setDatatype
-
Constructor Details
-
PrimitiveIntegerHelper
public PrimitiveIntegerHelper()Constructs a new helper. -
PrimitiveIntegerHelper
Constructs a new helper for the given primitive integer datatype.- Throws:
IllegalArgumentException- if datatype isnull.
-
-
Method Details
-
getWrapperTypeHelper
Description copied from interface:PrimitiveDatatypeHelperRetrieves theDatatypeHelperfor the wrapper type of the primitive type for which this helper is responsible.- Returns:
- The
DatatypeHelperof the not primitive wrapper type
-
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. -
toWrapper
Description copied from interface:PrimitiveDatatypeHelperGiven a JavaCodeFragment containing an expression of the primitive type this is a helper for, returns a JavaCodeFragment that converts the given expression to the appropriate wrapper class. -
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
-