Class BaseFieldReferenceLazy
java.lang.Object
io.github.mmm.code.base.item.BaseItem
io.github.mmm.code.base.expression.BaseExpression
io.github.mmm.code.base.expression.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)
-
Field Summary
Fields inherited from interface io.github.mmm.code.api.item.CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionBaseFieldReferenceLazy(BaseContext context, String typeName, Boolean qualified, String fieldName) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) io.github.mmm.code.api.expression.CodeConstantevaluate()io.github.mmm.code.api.expression.CodeExpressionio.github.mmm.code.api.language.CodeLanguageio.github.mmm.code.api.member.CodeFieldio.github.mmm.code.api.type.CodeGenericTypegetType()Methods inherited from class BaseItem
getOwningType, getSourceCode, getSpaces, toString, writeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.code.api.item.CodeItem
getSourceCode, write, write, write, write, write, write
-
Constructor Details
-
BaseFieldReferenceLazy
public BaseFieldReferenceLazy(BaseContext context, String typeName, Boolean qualified, String fieldName) The constructor.- Parameters:
context- theBaseContext.typeName- the fully qualified type name.qualified- -Boolean#TRUEforqualified,Boolean#FALSEfor unqualified, andnullto omittypein reference.fieldName- the field name.
-
-
Method Details
-
getExpression
public io.github.mmm.code.api.expression.CodeExpression getExpression()- Specified by:
getExpressionin interfaceio.github.mmm.code.api.expression.CodeMemberReference
-
getType
public io.github.mmm.code.api.type.CodeGenericType getType()- Specified by:
getTypein interfaceio.github.mmm.code.api.expression.CodeMemberReference
-
evaluate
public io.github.mmm.code.api.expression.CodeConstant evaluate()- Specified by:
evaluatein interfaceio.github.mmm.code.api.expression.CodeExpression
-
getMember
public io.github.mmm.code.api.member.CodeField getMember()- Specified by:
getMemberin interfaceio.github.mmm.code.api.expression.CodeFieldReference- Specified by:
getMemberin interfaceio.github.mmm.code.api.expression.CodeMemberReference
-
getLanguage
public io.github.mmm.code.api.language.CodeLanguage getLanguage()- Specified by:
getLanguagein interfaceio.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:
doWritein classBaseItem- Parameters:
sink- theAppendablewhere toappendthe code from thisCodeItem.newline- the newlineString.defaultIndent- theStringused 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 thedefaultIndentwill be appended.language- theCodeLanguageto use.- Throws:
IOException- if thrown byAppendable.- See Also:
-