Class ArrayOfValueDatatypeHelper

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

public class ArrayOfValueDatatypeHelper extends AbstractDatatypeHelper
A helper class for ArrayOfValueDatatype. ValueOf and newInstance expressions are not supported by this helper. A call to these method returns a "null" fragment.
Author:
Peter Erzberger
  • Constructor Details

  • Method Details

    • setDatatype

      public void setDatatype(Datatype datatype)
      Description copied from interface: DatatypeHelper
      Sets the datatype this is a helper for. Introduced to enable setter based dependency injection, needed for example for Eclipse's extension point mechanism.
      Specified by:
      setDatatype in interface BaseDatatypeHelper<JavaCodeFragment>
      Specified by:
      setDatatype in interface DatatypeHelper
      Overrides:
      setDatatype in class AbstractDatatypeHelper
    • getDatatype

      public ArrayOfValueDatatype getDatatype()
      Description copied from interface: DatatypeHelper
      Returns the datatype this is a helper for.
      Specified by:
      getDatatype in interface BaseDatatypeHelper<JavaCodeFragment>
      Specified by:
      getDatatype in interface DatatypeHelper
      Overrides:
      getDatatype in class AbstractDatatypeHelper
    • getJavaClassName

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

      protected JavaCodeFragment valueOfExpression(String expression)
      Returns a "null" fragment. 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
    • newInstance

      public JavaCodeFragment newInstance(String value)
      Returns a "null" fragment. 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 appropriate null object.