Package org.openrewrite.java.tree
Class J.ClassDecl
- java.lang.Object
-
- org.openrewrite.java.tree.J.ClassDecl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
J.ClassDecl.Extends
static class
J.ClassDecl.Implements
static class
J.ClassDecl.Kind
-
Nested classes/interfaces inherited from interface org.openrewrite.java.tree.J
J.AnnotatedType, J.Annotation, J.ArrayAccess, J.ArrayType, J.Assert, J.Assign, J.AssignOp, J.Binary, J.Block<T extends J>, J.Break, J.Case, J.ClassDecl, J.CompilationUnit, J.Continue, J.DoWhileLoop, J.Empty, J.EnumValue, J.EnumValueSet, J.FieldAccess, J.ForEachLoop, J.ForLoop, J.Ident, J.If, J.Import, J.InstanceOf, J.Label, J.Lambda, J.Literal, J.MemberReference, J.MethodDecl, J.MethodInvocation, J.Modifier, J.MultiCatch, J.NewArray, J.NewClass, J.Package, J.ParameterizedType, J.Parentheses<T extends J>, J.Primitive, J.Return, J.Switch, J.Synchronized, J.Ternary, J.Throw, J.Try, J.TypeCast, J.TypeParameter, J.TypeParameters, J.Unary, J.UnparsedSource, J.VariableDecls, J.WhileLoop, J.Wildcard
-
-
Constructor Summary
Constructors Constructor Description ClassDecl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
acceptJava(JavaSourceVisitor<R> v)
java.util.List<J.Annotation>
findAnnotations(java.lang.String signature)
java.util.List<J.VariableDecls>
findFields(java.lang.String clazz)
Find fields defined on this class, but do not include inherited fields up the type hierarchyjava.util.List<JavaType.Var>
findInheritedFields(java.lang.String clazz)
Find fields defined up the type hierarchy, but do not include fields defined directly on this classjava.util.List<J.MethodInvocation>
findMethodCalls(java.lang.String signature)
java.util.Set<NameTree>
findType(java.lang.String clazz)
J.EnumValueSet
getEnumValues()
J.ClassDecl.Extends
getExtends()
java.util.List<J.VariableDecls>
getFields()
J.ClassDecl.Implements
getImplements()
java.util.List<J.MethodDecl>
getMethods()
java.lang.String
getSimpleName()
boolean
hasModifier(java.lang.String modifier)
boolean
hasType(java.lang.String clazz)
boolean
isAnnotation()
boolean
isClass()
boolean
isEnum()
boolean
isInterface()
J.ClassDecl
withExtends(J.ClassDecl.Extends extendings)
J.ClassDecl
withImplements(J.ClassDecl.Implements implementings)
J.ClassDecl
withModifiers(java.lang.String... modifierKeywords)
J.ClassDecl
withModifiers(java.util.List<J.Modifier> modifiers)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrewrite.java.tree.Statement
hasClassType, isSemicolonTerminated
-
-
-
-
Method Detail
-
withModifiers
public J.ClassDecl withModifiers(java.util.List<J.Modifier> modifiers)
-
withModifiers
public J.ClassDecl withModifiers(java.lang.String... modifierKeywords)
-
withExtends
public J.ClassDecl withExtends(@Nullable J.ClassDecl.Extends extendings)
-
getExtends
@Nullable public J.ClassDecl.Extends getExtends()
-
withImplements
public J.ClassDecl withImplements(@Nullable J.ClassDecl.Implements implementings)
-
getImplements
@Nullable public J.ClassDecl.Implements getImplements()
-
acceptJava
public <R> R acceptJava(JavaSourceVisitor<R> v)
- Specified by:
acceptJava
in interfaceJ
-
getSimpleName
public java.lang.String getSimpleName()
-
getEnumValues
@Nullable public J.EnumValueSet getEnumValues()
-
getFields
public java.util.List<J.VariableDecls> getFields()
-
getMethods
public java.util.List<J.MethodDecl> getMethods()
-
findFields
public java.util.List<J.VariableDecls> findFields(java.lang.String clazz)
Find fields defined on this class, but do not include inherited fields up the type hierarchy
-
findInheritedFields
public java.util.List<JavaType.Var> findInheritedFields(java.lang.String clazz)
Find fields defined up the type hierarchy, but do not include fields defined directly on this class
-
findMethodCalls
public java.util.List<J.MethodInvocation> findMethodCalls(java.lang.String signature)
-
findType
public java.util.Set<NameTree> findType(java.lang.String clazz)
-
findAnnotations
public java.util.List<J.Annotation> findAnnotations(java.lang.String signature)
-
hasType
public boolean hasType(java.lang.String clazz)
-
hasModifier
public boolean hasModifier(java.lang.String modifier)
-
isEnum
public boolean isEnum()
-
isClass
public boolean isClass()
-
isInterface
public boolean isInterface()
-
isAnnotation
public boolean isAnnotation()
-
-