Class GregorianCalendarAsDateHelper

java.lang.Object
org.faktorips.codegen.dthelpers.AbstractDatatypeHelper
org.faktorips.codegen.dthelpers.GregorianCalendarAsDateHelper
All Implemented Interfaces:
BaseDatatypeHelper<JavaCodeFragment>, DatatypeHelper

public class GregorianCalendarAsDateHelper extends AbstractDatatypeHelper
  • Constructor Details

    • GregorianCalendarAsDateHelper

      public GregorianCalendarAsDateHelper()
      Constructs a new helper.
    • GregorianCalendarAsDateHelper

      public GregorianCalendarAsDateHelper(GregorianCalendarAsDateDatatype datatype)
      Constructs a new helper for the given boolean datatype.
      Throws:
      IllegalArgumentException - if datatype is null.
  • Method Details

    • getJavaClassName

      public String getJavaClassName()
      Description copied from interface: DatatypeHelper
      Returns the qualified Java class name the datatype represents.
    • newInstance

      public JavaCodeFragment newInstance(String value)
      Description copied from interface: DatatypeHelper
      Returns 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

      protected JavaCodeFragment valueOfExpression(String expression)
      Description copied from class: AbstractDatatypeHelper
      This method is supposed to be overridden by subclasses.

      It is used within the newInstanceFromExpression(String) method. It returns a JavaCodeFragment with sourcecode that creates an instance of the datatype's Java class with the given expression.

      If the expression is null the 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:
      valueOfExpression in class AbstractDatatypeHelper
    • newSafeCopy

      protected JavaCodeFragment newSafeCopy(String expression)
      Description copied from class: AbstractDatatypeHelper
      Helpers for immutable datatypes must override this method to create a copy of the value given in the expression.
      Overrides:
      newSafeCopy in class AbstractDatatypeHelper
      Parameters:
      expression - The expression of which you want to get the new safe copy code fragment from