Constructors

Link copied to clipboard
constructor(tokenRange: TokenRange, modifiers: NodeList<Modifier>, annotations: NodeList<AnnotationExpr>, typeParameters: NodeList<TypeParameter>, name: SimpleName, parameters: NodeList<Parameter>, thrownExceptions: NodeList<ReferenceType>, receiverParameter: ReceiverParameter, contracts: NodeList<JmlContract>)
This constructor is used by the parser and is considered private.

Types

Link copied to clipboard
open class Signature
A method or constructor signature.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private open var comment: Comment
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var name: SimpleName
Link copied to clipboard
This can be used to sort nodes on position.
Link copied to clipboard
Link copied to clipboard
private open var parentNode: Node
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private open var range: Range
Link copied to clipboard
Link copied to clipboard
private open var tokenRange: TokenRange
Link copied to clipboard

Functions

Link copied to clipboard
abstract fun <R, A> accept(v: GenericVisitor<R, A>, arg: A): R
abstract fun <A> accept(v: VoidVisitor<A>, arg: A)
Accept method for visitor support.
Link copied to clipboard
Annotates this node and automatically add the import
Annotates this
Link copied to clipboard
open fun addAndGetParameter(parameter: Parameter): Parameter
open fun addAndGetParameter(type: Type, name: String): Parameter
open fun addAndGetParameter(paramClass: Class<out Any>, name: String): Parameter

open fun addAndGetParameter(className: String, name: String): Parameter
Remember to import the class in the compilation unit yourself
Link copied to clipboard
open fun addAnnotation(element: AnnotationExpr): N

open fun addAnnotation(clazz: Class<out Annotation>): N
Annotates this node and automatically add the import
open fun addAnnotation(name: String): N
Annotates this
Link copied to clipboard
open fun addContract(contracts: JmlContract)
Link copied to clipboard
open fun addContracts(contracts: Array<JmlContract>)
Link copied to clipboard
open fun addMarkerAnnotation(clazz: Class<out Annotation>): N
Annotates this with a marker annotation and automatically add the import
open fun addMarkerAnnotation(name: String): N
Annotates this with a marker annotation
Link copied to clipboard
open fun addModifier(newModifiers: Array<Modifier.Keyword>): N
Link copied to clipboard
open fun addOrphanComment(comment: Comment)
Link copied to clipboard
open fun addParameter(parameter: Parameter): N
open fun addParameter(type: Type, name: String): N
open fun addParameter(paramClass: Class<out Any>, name: String): N

open fun addParameter(className: String, name: String): N
Remember to import the class in the compilation unit yourself
Link copied to clipboard
open fun addSingleMemberAnnotation(clazz: Class<out Annotation>, expression: Expression): N
open fun addSingleMemberAnnotation(name: String, expression: Expression): N
open fun addSingleMemberAnnotation(name: String, value: String): N
Annotates this with a single member annotation
open fun addSingleMemberAnnotation(clazz: Class<out Annotation>, value: String): N
Annotates this with a single member annotation and automatically add the import
Link copied to clipboard
open fun addThrownException(throwType: ReferenceType): N
Adds this type to the throws clause
open fun addThrownException(clazz: Class<out Throwable>): N
Adds this class to the throws clause
Link copied to clipboard
open fun addTypeParameter(typeParameter: TypeParameter): N

open fun addTypeParameter(typeParameter: String): N
Adds a type parameter like X extends Serializable
Link copied to clipboard
@NonNull
open fun annotations(): @NonNull NodeList<AnnotationExpr>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Nullable
open fun associatedSpecificationComments(): @Nullable NodeList<Comment>
Link copied to clipboard
Link copied to clipboard
open fun clone(): Node
open fun clone(): CallableDeclaration<out Any>
Link copied to clipboard
@Nullable
open fun comment(): @Nullable Comment
Link copied to clipboard
open fun containsData(key: DataKey<out Any>): Boolean
Link copied to clipboard
open fun containsWithin(other: Node): Boolean
Link copied to clipboard
open fun containsWithinRange(other: Node): Boolean
Checks whether the range of the given Node is contained within the range of this NodeWithRange.
Link copied to clipboard
@NonNull
open fun contracts(): @NonNull NodeList<JmlContract>
Link copied to clipboard
open fun equals(obj: Any): Boolean
Link copied to clipboard
open fun <T : Node?> findAll(nodeType: Class<T>): List<T>
Walks the AST with pre-order traversal, returning all nodes of type "nodeType".
open fun <T : Node?> findAll(nodeType: Class<T>, traversal: Node.TreeTraversal): List<T>
Walks the AST with specified traversal order, returning all nodes of type "nodeType".
open fun <T : Node?> findAll(nodeType: Class<T>, predicate: Predicate<T>): List<T>
Walks the AST with pre-order traversal, returning all nodes of type "nodeType" that match the predicate.
Link copied to clipboard
open fun <N> findAncestor(types: Array<Class<N>>): Optional<N>
Walks the parents of this node and returns the first node of type type, or empty() if none is found.
open fun <N> findAncestor(type: Class<N>, predicate: Predicate<N>): Optional<N>
Walks the parents of this node and returns the first node of type type that matches predicate, or empty() if none is found.
open fun <N> findAncestor(predicate: Predicate<N>, types: Array<Class<N>>): Optional<N>
Walks the parents of this node and returns the first node that matches one of types types, or empty() if none is found.
Link copied to clipboard
open fun findByRange(range: Range): Optional<Node>
Link copied to clipboard
Link copied to clipboard
open fun <M> findData(key: DataKey<M>): Optional<M>
Gets data for this node using the given key or returns an Optional.empty().
Link copied to clipboard
open fun <N : Node?> findFirst(nodeType: Class<N>): Optional<N>
Walks the AST with pre-order traversal, returning the first node of type "nodeType" or empty() if none is found.
open fun <T> findFirst(traversal: Node.TreeTraversal, consumer: (Node) -> Optional<T>): Optional<T>
Walks the AST, applying the function for every node, with traversal algorithm "traversal".
open fun <N : Node?> findFirst(nodeType: Class<N>, predicate: Predicate<N>): Optional<N>
Walks the AST with pre-order traversal, returning the first node of type "nodeType" that matches "predicate" or empty() if none is found.
Link copied to clipboard
open fun findRootNode(): Node
Finds the root node of this AST by finding the topmost parent.
Link copied to clipboard
Link copied to clipboard
This is the list of Comment which are contained in the Node either because they are properly associated to one of its children or because they are floating around inside the Node
Link copied to clipboard
Link copied to clipboard
open fun getAnnotationByClass(annotationClass: Class<out Annotation>): Optional<AnnotationExpr>
Try to find an annotation by its class
Link copied to clipboard
Try to find an annotation by its name
Link copied to clipboard
This field is used by key to associated (JML) comments to this node.
Link copied to clipboard
The begin position of this node in the source file.
Link copied to clipboard
open fun getChildNodes(): List<Node>
Contains all nodes that have this node set as their parent.
Link copied to clipboard
open fun <N : Node?> getChildNodesByType(clazz: Class<N>): List<N>
Recursively finds all nodes of a certain type.
Link copied to clipboard
abstract fun getComment(): Optional<Comment>
Link copied to clipboard
open fun <M> getData(key: DataKey<M>): M
Gets data for this node using the given key.
Link copied to clipboard
open fun getDataKeys(): Set<DataKey<out Any>>
This method was added to support the clone method.
Link copied to clipboard
As getDeclarationAsString including the modifiers, the throws clause and the parameters with both type and name.
open fun getDeclarationAsString(includingModifiers: Boolean, includingThrows: Boolean): String
As getDeclarationAsString including the parameters with both type and name.
abstract fun getDeclarationAsString(includingModifiers: Boolean, includingThrows: Boolean, includingParameterName: Boolean): String
A simple representation of the element declaration.
Link copied to clipboard
open fun getEnd(): Optional<Position>
The end position of this node in the source file.
Link copied to clipboard
Gets the Javadoc for this node.
Link copied to clipboard
Gets the JavadocComment for this node.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <N : Node?> getNodesByType(clazz: Class<N>): List<N>
Link copied to clipboard
This is a list of Comment which are inside the node and are not associated with any meaningful AST Node.
Link copied to clipboard
open fun getParameter(i: Int): Parameter
Link copied to clipboard
Try to find a Parameter by its name
Link copied to clipboard
Try to find a Parameter by its type
Link copied to clipboard
Returns the parent node, or Optional.empty if no parent is set.
Link copied to clipboard
Returns the parent node from the perspective of the children of this node.
Link copied to clipboard
open fun <T : Node?> getParentNodeOfType(clazz: Class<T>): Optional<T>
Finds the first parent of the given class.
Link copied to clipboard
open fun getRange(): Optional<Range>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
open fun hasModifier(modifier: Modifier.Keyword): Boolean
Link copied to clipboard
open fun hasParametersOfType(paramTypes: Array<Class<out Any>>): Boolean
open fun hasParametersOfType(paramTypes: Array<String>): Boolean
Check if the parameters have certain types.
Link copied to clipboard
Returns true if the parent has a parent
Link copied to clipboard
open fun hasRange(): Boolean
Link copied to clipboard
open fun hasScope(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun ifJmlDocType(action: Consumer<JmlDocType>)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isAbstract(): Boolean
Link copied to clipboard
open fun isAncestorOf(descendant: Node): Boolean
Determines whether this node is an ancestor of the given node.
Link copied to clipboard
Link copied to clipboard
open fun isAnnotationPresent(annotationClass: Class<out Annotation>): Boolean
Check whether an annotation with this class is present on this element
open fun isAnnotationPresent(annotationName: String): Boolean
Check whether an annotation with this name is present on this element
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isDescendantOf(ancestor: Node): Boolean
Determines whether this HasParentNode node is a descendant of the given node.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isFinal(): Boolean
Link copied to clipboard
Link copied to clipboard
open fun isGeneric(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isJmlDocType(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isPhantom(): Boolean
Link copied to clipboard
open fun isPrivate(): Boolean
Link copied to clipboard
open fun isProtected(): Boolean
Link copied to clipboard
open fun isPublic(): Boolean
Link copied to clipboard
Link copied to clipboard
open fun isRegistered(observer: AstObserver): Boolean
Was this observer registered?
Link copied to clipboard
open fun isStatic(): Boolean
Link copied to clipboard
open fun isStrictfp(): Boolean
Link copied to clipboard
open fun isThrown(clazz: Class<out Throwable>): Boolean
Check whether this elements throws this exception class.
open fun isThrown(throwableName: String): Boolean
Check whether this elements throws this exception class Note that this is simply a text compare, no actual type resolution takes place.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@NonNull
open fun modifiers(): @NonNull NodeList<Modifier>
Link copied to clipboard
@NonNull
open fun name(): @NonNull SimpleName
Link copied to clipboard
open fun <P> notifyPropertyChange(property: ObservableProperty, oldValue: P, newValue: P)
Link copied to clipboard
@NonNull
open fun parameters(): @NonNull NodeList<Parameter>
Link copied to clipboard
@Nullable
open fun receiverParameter(): @Nullable ReceiverParameter
Link copied to clipboard
open fun register(observer: AstObserver)
Register an observer.
Register a new observer for the given node.
Link copied to clipboard
open fun registerForSubtree(observer: AstObserver)
Register the observer for the current node and all the contained node and nodelists, recursively.
Link copied to clipboard
open fun remove(): Boolean
Try to remove this node from the parent
open fun remove(node: Node): Boolean
Link copied to clipboard
open fun removeComment(): Node
Link copied to clipboard
open fun removeData(key: DataKey<out Any>)
Remove data by key.
Link copied to clipboard
open fun removeForced()
Forcibly removes this node from the AST.
Link copied to clipboard
Link copied to clipboard
open fun removeModifier(modifiersToRemove: Array<Modifier.Keyword>): N
Link copied to clipboard
open fun removeOrphanComment(comment: Comment): Boolean
Link copied to clipboard
open fun replace(node: Node): Boolean
Try to replace this node in the parent with the supplied node.
open fun replace(node: Node, replacementNode: Node): Boolean
Link copied to clipboard
open fun setAbstract(set: Boolean): N
Link copied to clipboard
open fun setAnnotation(i: Int, element: AnnotationExpr): N
Link copied to clipboard
open fun setAssociatedSpecificationComments(@Nullable associatedSpecificationComments: @Nullable NodeList<Comment>): Node
Link copied to clipboard
fun setBlockComment(comment: String): Node
Use this to store additional information to this node.
Link copied to clipboard
abstract fun setContracts(contracts: NodeList<JmlContract>): N
Link copied to clipboard
open fun <M> setData(key: DataKey<M>, object: M)
Sets data for this node using the given key.
Link copied to clipboard
open fun setFinal(set: Boolean): N
Link copied to clipboard
open fun setJavadocComment(comment: JavadocComment): N
open fun setJavadocComment(javadoc: Javadoc): N
open fun setJavadocComment(indentation: String, javadoc: Javadoc): N

open fun setJavadocComment(comment: String): N
open fun setJavadocComment(comment: String, isMarkdownComment: Boolean): N
Set a JavadocComment for this node
Link copied to clipboard
fun setLineComment(comment: String): Node
Use this to store additional information to this node.
Link copied to clipboard
Link copied to clipboard
open fun setModifiers(modifiers: Array<Modifier.Keyword>): N
open fun setModifiers(modifiers: List<Modifier.Keyword>): N
Creates a list of modifier nodes corresponding to the keywords passed, and set it.
abstract fun setModifiers(modifiers: NodeList<Modifier>): N
Link copied to clipboard
abstract fun setName(name: SimpleName): N
open fun setName(name: String): N
Link copied to clipboard
open fun setParameter(i: Int, parameter: Parameter): N
Link copied to clipboard
abstract fun setParameters(parameters: NodeList<Parameter>): N
Link copied to clipboard
open fun setPrivate(set: Boolean): N
Link copied to clipboard
open fun setProtected(set: Boolean): N
Link copied to clipboard
open fun setPublic(set: Boolean): N
Link copied to clipboard
open fun setReceiverParameter(@Nullable receiverParameter: @Nullable ReceiverParameter): T
Link copied to clipboard
open fun setStatic(set: Boolean): N
Link copied to clipboard
open fun setStrictfp(set: Boolean): N
Link copied to clipboard
abstract fun setThrownExceptions(thrownExceptions: NodeList<ReferenceType>): N
Link copied to clipboard
open fun setTypeParameter(i: Int, typeParameter: TypeParameter): N
Link copied to clipboard
abstract fun setTypeParameters(typeParameters: NodeList<TypeParameter>): N
Link copied to clipboard
open fun stream(): Stream<Node>
Make a stream of nodes using pre-order traversal.
open fun stream(traversal: Node.TreeTraversal): Stream<Node>
Make a stream of nodes using traversal algorithm "traversal".
Link copied to clipboard
@NonNull
open fun thrownExceptions(): @NonNull NodeList<ReferenceType>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@NonNull
open fun typeParameters(): @NonNull NodeList<TypeParameter>
Link copied to clipboard
open fun unregister(observer: AstObserver)
Unregister an observer.
Link copied to clipboard
open fun walk(consumer: Consumer<Node>)
Walks the AST, calling the consumer for every node with pre-order traversal.
open fun walk(traversal: Node.TreeTraversal, consumer: Consumer<Node>)
Walks the AST, calling the consumer for every node, with traversal algorithm "traversal".
open fun <T : Node?> walk(nodeType: Class<T>, consumer: Consumer<T>)
Walks the AST with pre-order traversal, calling the consumer for every node of type "nodeType".