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

build.lombok.ast_generatedSource.lombok.ast.ExpressionStatement Maven / Gradle / Ivy

Go to download

This is a very small fork of lombok.ast as some Android tools needed a few modifications. The normal repository for lombok.ast is here https://github.com/rzwitserloot/lombok.ast and our changes for 0.2.3 are in this pull request: https://github.com/rzwitserloot/lombok.ast/pull/8

The newest version!
//Generated by lombok.ast.template.TemplateProcessor. DO NOT EDIT, DO NOT CHECK IN!

package lombok.ast;

public class ExpressionStatement extends lombok.ast.AbstractNode implements lombok.ast.Statement {
	private lombok.ast.AbstractNode expression = null;
	
	public Block upToBlock() {
		if (!(this.getParent() instanceof Block)) return null;
		Block out = (Block)this.getParent();
		if (!out.rawContents().contains(this)) return null;
		return out;
	}
	
	
	public Expression astExpression() {
		if (!(this.expression instanceof Expression)) return null;
		return (Expression) this.expression;
	}
	
	public lombok.ast.ExpressionStatement astExpression(Expression expression) {
		if (expression == null) throw new java.lang.NullPointerException("expression is mandatory");
		return this.rawExpression(expression);
	}
	
	public lombok.ast.Node rawExpression() {
		return this.expression;
	}
	
	public lombok.ast.ExpressionStatement rawExpression(lombok.ast.Node expression) {
		if (expression == this.expression) return this;
		if (expression != null) this.adopt((lombok.ast.AbstractNode)expression);
		if (this.expression != null) this.disown(this.expression);
		this.expression = (lombok.ast.AbstractNode)expression;
		return this;
	}
	
	@java.lang.Override public java.util.List getChildren() {
		java.util.List result = new java.util.ArrayList();
		if (this.expression != null) result.add(this.expression);
		return result;
	}
	
	@java.lang.Override public boolean replaceChild(Node original, Node replacement) throws lombok.ast.AstException {
		if (this.expression == original) {
			this.rawExpression(replacement);
			return true;
		}
		return false;
	}
	
	@java.lang.Override public boolean detach(Node child) {
		if (this.expression == child) {
			this.disown((AbstractNode) child);
			this.expression = null;
			return true;
		}
		return false;
	}
	
	@java.lang.Override public void accept(lombok.ast.AstVisitor visitor) {
		if (visitor.visitExpressionStatement(this)) return;
		if (this.expression != null) this.expression.accept(visitor);
		visitor.afterVisitExpressionStatement(this);
		visitor.endVisit(this);
	}
	
	@java.lang.Override public ExpressionStatement copy() {
		ExpressionStatement result = new ExpressionStatement();
		if (this.expression != null) result.rawExpression(this.expression.copy());
		return result;
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy