MCPcopy Create free account
hub / github.com/apache/groovy / getField

Method getField

src/main/java/org/codehaus/groovy/ast/ClassNode.java:1211–1219  ·  view source on GitHub ↗

Finds a FieldNode matching the given name in this class or any of its superclasses. This method searches the inheritance hierarchy starting from this ClassNode and moving up through superclasses until a field with the matching name is found. @param name the name of the field to find @return

(String name)

Source from the content-addressed store, hash-verified

1209 * @see #getFields()
1210 */
1211 public FieldNode getField(String name) {
1212 ClassNode node = this;
1213 while (node != null) {
1214 FieldNode fn = node.getDeclaredField(name);
1215 if (fn != null) return fn;
1216 node = node.getSuperClass();
1217 }
1218 return null;
1219 }
1220
1221 public List<Statement> getObjectInitializerStatements() {
1222 if (objectInitializers == null)

Callers 15

addValidatedNameMethod · 0.95
transformMethod · 0.95
applyTraitMethod · 0.95
visitPropertyMethod · 0.45
visitPropertyMethod · 0.45
getObjectPropertiesMethod · 0.45
testInitOrderMethod · 0.45
visitPropertyMethod · 0.45
visitPropertyMethod · 0.45

Calls 2

getDeclaredFieldMethod · 0.95
getSuperClassMethod · 0.95

Tested by 1

testInitOrderMethod · 0.36