Class BaseFieldReferenceLazy

All Implemented Interfaces:
io.github.mmm.code.api.expression.CodeExpression, io.github.mmm.code.api.expression.CodeFieldReference, io.github.mmm.code.api.expression.CodeMemberReference, io.github.mmm.code.api.item.CodeItem

public class BaseFieldReferenceLazy extends BaseExpression implements io.github.mmm.code.api.expression.CodeFieldReference
Implementation of CodeFieldReference with lazy evaluation.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Constructor Details

    • BaseFieldReferenceLazy

      public BaseFieldReferenceLazy(BaseContext context, String typeName, Boolean qualified, String fieldName)
      The constructor.
      Parameters:
      context - the BaseContext.
      typeName - the fully qualified type name.
      qualified - - Boolean#TRUE for qualified, Boolean#FALSE for unqualified, and null to omit type in reference.
      fieldName - the field name.
  • Method Details

    • getExpression

      public io.github.mmm.code.api.expression.CodeExpression getExpression()
      Specified by:
      getExpression in interface io.github.mmm.code.api.expression.CodeMemberReference
    • getType

      public io.github.mmm.code.api.type.CodeGenericType getType()
      Specified by:
      getType in interface io.github.mmm.code.api.expression.CodeMemberReference
    • evaluate

      public io.github.mmm.code.api.expression.CodeConstant evaluate()
      Specified by:
      evaluate in interface io.github.mmm.code.api.expression.CodeExpression
    • getMember

      public io.github.mmm.code.api.member.CodeField getMember()
      Specified by:
      getMember in interface io.github.mmm.code.api.expression.CodeFieldReference
      Specified by:
      getMember in interface io.github.mmm.code.api.expression.CodeMemberReference
    • getLanguage

      public io.github.mmm.code.api.language.CodeLanguage getLanguage()
      Specified by:
      getLanguage in interface io.github.mmm.code.api.item.CodeItem
    • doWrite

      protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException
      Specified by:
      doWrite in class BaseItem
      Parameters:
      sink - the Appendable where to append the code from this CodeItem.
      newline - the newline String.
      defaultIndent - the String used for indentation (e.g. a number of spaces to insert per indent level).
      currentIndent - the current indent (number of spaces). Initially the empty string (""). Before a recursion the defaultIndent will be appended.
      language - the CodeLanguage to use.
      Throws:
      IOException - if thrown by Appendable.
      See Also:
      • CodeItem.write(Appendable, String, String)