public class NamedElementFilter<T extends CtNamedElement> extends java.lang.Object implements Filter<T>
CtMethod<?> normalFor = type.getElements( new NamedElementFilter<CtMethod<?>>(CtMethod.class, "normalFor")).get(0);
Constructor and Description |
---|
NamedElementFilter(java.lang.Class<T> acceptedClass,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<T> |
getType() |
boolean |
matches(T element)
Tells if the given element matches.
|
public NamedElementFilter(java.lang.Class<T> acceptedClass, java.lang.String name)
name
- Name of the expected elementacceptedClass
- Expected class of the resultspublic boolean matches(T element)
Filter
matches
in interface Filter<T extends CtNamedElement>
element
- - the element to be checked for a match. Parameter element is never null if Query
is used.public java.lang.Class<T> getType()
Copyright © 2007–2021 Inria. All rights reserved.