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

build.lombok.ast_generatedSource.lombok.ast.Annotation 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 Annotation extends lombok.ast.AbstractNode implements lombok.ast.DescribedNode, lombok.ast.AnnotationValue {
	private lombok.ast.AbstractNode annotationTypeReference = null;
	lombok.ast.ListAccessor elements = ListAccessor.of(this, AnnotationElement.class, "Annotation.elements");
	
	public Modifiers upToModifiers() {
		if (!(this.getParent() instanceof Modifiers)) return null;
		Modifiers out = (Modifiers)this.getParent();
		if (!out.rawAnnotations().contains(this)) return null;
		return out;
	}
	
	
	public TypeReference astAnnotationTypeReference() {
		if (!(this.annotationTypeReference instanceof TypeReference)) return null;
		return (TypeReference) this.annotationTypeReference;
	}
	
	public lombok.ast.Annotation astAnnotationTypeReference(TypeReference annotationTypeReference) {
		if (annotationTypeReference == null) throw new java.lang.NullPointerException("annotationTypeReference is mandatory");
		return this.rawAnnotationTypeReference(annotationTypeReference);
	}
	
	public lombok.ast.Node rawAnnotationTypeReference() {
		return this.annotationTypeReference;
	}
	
	public lombok.ast.Annotation rawAnnotationTypeReference(lombok.ast.Node annotationTypeReference) {
		if (annotationTypeReference == this.annotationTypeReference) return this;
		if (annotationTypeReference != null) this.adopt((lombok.ast.AbstractNode)annotationTypeReference);
		if (this.annotationTypeReference != null) this.disown(this.annotationTypeReference);
		this.annotationTypeReference = (lombok.ast.AbstractNode)annotationTypeReference;
		return this;
	}
	
	public lombok.ast.RawListAccessor rawElements() {
		return this.elements.asRaw();
	}
	
	public lombok.ast.StrictListAccessor astElements() {
		return this.elements.asStrict();
	}
	
	@java.lang.Override public java.util.List getChildren() {
		java.util.List result = new java.util.ArrayList();
		if (this.annotationTypeReference != null) result.add(this.annotationTypeReference);
		result.addAll(this.elements.backingList());
		return result;
	}
	
	@java.lang.Override public boolean replaceChild(Node original, Node replacement) throws lombok.ast.AstException {
		if (this.annotationTypeReference == original) {
			this.rawAnnotationTypeReference(replacement);
			return true;
		}
		if (this.rawElements().replace(original, replacement)) return true;
		return false;
	}
	
	@java.lang.Override public boolean detach(Node child) {
		if (this.annotationTypeReference == child) {
			this.disown((AbstractNode) child);
			this.annotationTypeReference = null;
			return true;
		}
		if (this.rawElements().remove(child)) return true;
		return false;
	}
	
	@java.lang.Override public void accept(lombok.ast.AstVisitor visitor) {
		if (visitor.visitAnnotation(this)) return;
		if (this.annotationTypeReference != null) this.annotationTypeReference.accept(visitor);
		for (lombok.ast.Node child : this.elements.asIterable()) {
			child.accept(visitor);
		}
		visitor.afterVisitAnnotation(this);
		visitor.endVisit(this);
	}
	
	@java.lang.Override public Annotation copy() {
		Annotation result = new Annotation();
		if (this.annotationTypeReference != null) result.rawAnnotationTypeReference(this.annotationTypeReference.copy());
		for (Node n : this.elements.backingList()) {
			result.rawElements().addToEnd(n == null ? null : n.copy());
		}
		return result;
	}
	
	public java.lang.String getDescription() {
		return lombok.ast.AnnotationTemplate.getDescription(this);
	}
	
	public java.util.List getValueValues() {
		return lombok.ast.AnnotationTemplate.getValueValues(this);
	}
	
	public java.util.List getValues(java.lang.String key) {
		return lombok.ast.AnnotationTemplate.getValues(this, key);
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy