All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.mmm.code.api.statement.CodeLocalVariable Maven / Gradle / Ivy

There is a newer version: 1.0.0-beta7
Show newest version
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.code.api.statement;

import net.sf.mmm.code.api.expression.CodeExpression;
import net.sf.mmm.code.api.expression.CodeVariable;
import net.sf.mmm.code.api.item.CodeItemWithModifiers;
import net.sf.mmm.code.api.modifier.CodeModifiers;

/**
 * {@link CodeVariable} that is locally defined in a {@link net.sf.mmm.code.api.block.CodeBlock}.
* Syntax:
 * [{@link #isFinal() final}] «{@link #getType() type}» «{@link #getName() name}» [ = «{@link #getExpression() expression}»]
 * 
* * @author Joerg Hohwiller (hohwille at users.sourceforge.net) * @since 1.0.0 */ public interface CodeLocalVariable extends CodeVariable, CodeItemWithModifiers, CodeAssignment { /** * @return true if {@link CodeModifiers#isFinal() final}. */ boolean isFinal(); @Override default CodeLocalVariable getVariable() { return this; } /** * @return the optional {@link CodeExpression} used to initialize this variable. May be {@code null} for no * initialization. */ @Override CodeExpression getExpression(); @Override default CodeModifiers getModifiers() { if (isFinal()) { return CodeModifiers.MODIFIERS_FINAL; } else { return CodeModifiers.MODIFIERS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy