Package org.faktorips.codegen.dthelpers
Class GregorianCalendarAsDateHelper
java.lang.Object
org.faktorips.codegen.dthelpers.AbstractDatatypeHelper
org.faktorips.codegen.dthelpers.GregorianCalendarAsDateHelper
- 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.Constructs a new helper for the given boolean datatype. -
Method Summary
Modifier and TypeMethodDescriptionReturns the qualified Java class name the datatype represents.newInstance(String value) Returns a JavaCodeFragment with sourcecode that creates an instance of the datatype's Java class with the given value.protected JavaCodeFragmentnewSafeCopy(String expression) Helpers for immutable datatypes must override this method to create a copy of the value given in the expression.protected JavaCodeFragmentvalueOfExpression(String expression) This method is supposed to be overridden by subclasses.Methods inherited from class org.faktorips.codegen.dthelpers.AbstractDatatypeHelper
getDatatype, getRangeJavaClassName, getToStringExpression, newEnumValueSetInstance, newEnumValueSetInstance, newInstanceFromExpression, newInstanceFromExpression, newRangeInstance, nullExpression, referenceOrSafeCopyIfNeccessary, setDatatype
-
Constructor Details
-
GregorianCalendarAsDateHelper
public GregorianCalendarAsDateHelper()Constructs a new helper. -
GregorianCalendarAsDateHelper
Constructs a new helper for the given boolean 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 a JavaCodeFragment with 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 apropriate 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
-
newSafeCopy
Description copied from class:AbstractDatatypeHelperHelpers for immutable datatypes must override this method to create a copy of the value given in the expression.- Overrides:
newSafeCopyin classAbstractDatatypeHelper- Parameters:
expression- The expression of which you want to get the new safe copy code fragment from
-