
build.lombok.ast_generatedSource.lombok.ast.ConstructorDeclaration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lombok-ast Show documentation
Show all versions of lombok-ast Show documentation
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 ConstructorDeclaration extends lombok.ast.AbstractNode implements lombok.ast.TypeMember, lombok.ast.JavadocContainer {
private lombok.ast.AbstractNode javadoc = null;
private lombok.ast.AbstractNode modifiers = adopt(new lombok.ast.Modifiers());
lombok.ast.ListAccessor typeVariables = ListAccessor.of(this, TypeVariable.class, "ConstructorDeclaration.typeVariables");
private lombok.ast.AbstractNode typeName = adopt(new lombok.ast.Identifier());
lombok.ast.ListAccessor parameters = ListAccessor.of(this, VariableDefinition.class, "ConstructorDeclaration.parameters");
lombok.ast.ListAccessor thrownTypeReferences = ListAccessor.of(this, TypeReference.class, "ConstructorDeclaration.thrownTypeReferences");
private lombok.ast.AbstractNode body = null;
public TypeBody upToTypeBody() {
if (!(this.getParent() instanceof TypeBody)) return null;
TypeBody out = (TypeBody)this.getParent();
if (!out.rawMembers().contains(this)) return null;
return out;
}
public Comment astJavadoc() {
if (!(this.javadoc instanceof Comment)) return null;
return (Comment) this.javadoc;
}
public lombok.ast.ConstructorDeclaration astJavadoc(Comment javadoc) {
return this.rawJavadoc(javadoc);
}
public lombok.ast.Node rawJavadoc() {
return this.javadoc;
}
public lombok.ast.ConstructorDeclaration rawJavadoc(lombok.ast.Node javadoc) {
if (javadoc == this.javadoc) return this;
if (javadoc != null) this.adopt((lombok.ast.AbstractNode)javadoc);
if (this.javadoc != null) this.disown(this.javadoc);
this.javadoc = (lombok.ast.AbstractNode)javadoc;
return this;
}
public Modifiers astModifiers() {
if (!(this.modifiers instanceof Modifiers)) return null;
return (Modifiers) this.modifiers;
}
public lombok.ast.ConstructorDeclaration astModifiers(Modifiers modifiers) {
return this.rawModifiers(modifiers);
}
private lombok.ast.ConstructorDeclaration rawModifiers(lombok.ast.Node modifiers) {
if (modifiers == this.modifiers) return this;
if (modifiers != null) this.adopt((lombok.ast.AbstractNode)modifiers);
if (this.modifiers != null) this.disown(this.modifiers);
this.modifiers = (lombok.ast.AbstractNode)modifiers;
return this;
}
public lombok.ast.RawListAccessor rawTypeVariables() {
return this.typeVariables.asRaw();
}
public lombok.ast.StrictListAccessor astTypeVariables() {
return this.typeVariables.asStrict();
}
public Identifier astTypeName() {
if (!(this.typeName instanceof Identifier)) return null;
return (Identifier) this.typeName;
}
public lombok.ast.ConstructorDeclaration astTypeName(Identifier typeName) {
return this.rawTypeName(typeName);
}
private lombok.ast.ConstructorDeclaration rawTypeName(lombok.ast.Node typeName) {
if (typeName == this.typeName) return this;
if (typeName != null) this.adopt((lombok.ast.AbstractNode)typeName);
if (this.typeName != null) this.disown(this.typeName);
this.typeName = (lombok.ast.AbstractNode)typeName;
return this;
}
public lombok.ast.RawListAccessor rawParameters() {
return this.parameters.asRaw();
}
public lombok.ast.StrictListAccessor astParameters() {
return this.parameters.asStrict();
}
public lombok.ast.RawListAccessor rawThrownTypeReferences() {
return this.thrownTypeReferences.asRaw();
}
public lombok.ast.StrictListAccessor astThrownTypeReferences() {
return this.thrownTypeReferences.asStrict();
}
public Block astBody() {
if (!(this.body instanceof Block)) return null;
return (Block) this.body;
}
public lombok.ast.ConstructorDeclaration astBody(Block body) {
if (body == null) throw new java.lang.NullPointerException("body is mandatory");
return this.rawBody(body);
}
public lombok.ast.Node rawBody() {
return this.body;
}
public lombok.ast.ConstructorDeclaration rawBody(lombok.ast.Node body) {
if (body == this.body) return this;
if (body != null) this.adopt((lombok.ast.AbstractNode)body);
if (this.body != null) this.disown(this.body);
this.body = (lombok.ast.AbstractNode)body;
return this;
}
@java.lang.Override public java.util.List getChildren() {
java.util.List result = new java.util.ArrayList();
if (this.javadoc != null) result.add(this.javadoc);
if (this.modifiers != null) result.add(this.modifiers);
result.addAll(this.typeVariables.backingList());
if (this.typeName != null) result.add(this.typeName);
result.addAll(this.parameters.backingList());
result.addAll(this.thrownTypeReferences.backingList());
if (this.body != null) result.add(this.body);
return result;
}
@java.lang.Override public boolean replaceChild(Node original, Node replacement) throws lombok.ast.AstException {
if (this.javadoc == original) {
this.rawJavadoc(replacement);
return true;
}
if (this.modifiers == original) {
if (replacement instanceof Modifiers) {
this.astModifiers((Modifiers) replacement);
return true;
} else throw new lombok.ast.AstException(this, String.format(
"Cannot replace node: replacement must be of type %s but is of type %s",
"Modifiers", replacement == null ? "null" : replacement.getClass().getName()));
}
if (this.rawTypeVariables().replace(original, replacement)) return true;
if (this.typeName == original) {
if (replacement instanceof Identifier) {
this.astTypeName((Identifier) replacement);
return true;
} else throw new lombok.ast.AstException(this, String.format(
"Cannot replace node: replacement must be of type %s but is of type %s",
"Identifier", replacement == null ? "null" : replacement.getClass().getName()));
}
if (this.rawParameters().replace(original, replacement)) return true;
if (this.rawThrownTypeReferences().replace(original, replacement)) return true;
if (this.body == original) {
this.rawBody(replacement);
return true;
}
return false;
}
@java.lang.Override public boolean detach(Node child) {
if (this.javadoc == child) {
this.disown((AbstractNode) child);
this.javadoc = null;
return true;
}
if (this.modifiers == child) {
this.disown((AbstractNode) child);
this.modifiers = null;
return true;
}
if (this.rawTypeVariables().remove(child)) return true;
if (this.typeName == child) {
this.disown((AbstractNode) child);
this.typeName = null;
return true;
}
if (this.rawParameters().remove(child)) return true;
if (this.rawThrownTypeReferences().remove(child)) return true;
if (this.body == child) {
this.disown((AbstractNode) child);
this.body = null;
return true;
}
return false;
}
@java.lang.Override public void accept(lombok.ast.AstVisitor visitor) {
if (visitor.visitConstructorDeclaration(this)) return;
if (this.javadoc != null) this.javadoc.accept(visitor);
if (this.modifiers != null) this.modifiers.accept(visitor);
for (lombok.ast.Node child : this.typeVariables.asIterable()) {
child.accept(visitor);
}
if (this.typeName != null) this.typeName.accept(visitor);
for (lombok.ast.Node child : this.parameters.asIterable()) {
child.accept(visitor);
}
for (lombok.ast.Node child : this.thrownTypeReferences.asIterable()) {
child.accept(visitor);
}
if (this.body != null) this.body.accept(visitor);
visitor.afterVisitConstructorDeclaration(this);
visitor.endVisit(this);
}
@java.lang.Override public ConstructorDeclaration copy() {
ConstructorDeclaration result = new ConstructorDeclaration();
if (this.javadoc != null) result.rawJavadoc(this.javadoc.copy());
if (this.modifiers != null) result.rawModifiers(this.modifiers.copy());
for (Node n : this.typeVariables.backingList()) {
result.rawTypeVariables().addToEnd(n == null ? null : n.copy());
}
if (this.typeName != null) result.rawTypeName(this.typeName.copy());
for (Node n : this.parameters.backingList()) {
result.rawParameters().addToEnd(n == null ? null : n.copy());
}
for (Node n : this.thrownTypeReferences.backingList()) {
result.rawThrownTypeReferences().addToEnd(n == null ? null : n.copy());
}
if (this.body != null) result.rawBody(this.body.copy());
return result;
}
public lombok.ast.TypeDeclaration upUpToTypeDeclaration() {
return lombok.ast.TypeMemberMixin.upUpToTypeDeclaration(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy