MCPcopy Index your code
hub / github.com/antlr/codebuff / getProperty

Method getProperty

output/java8/1.4.13/ObjectModelAdaptor.java:57–81  ·  view source on GitHub ↗
(Interpreter interp, ST self, Object o, Object property, String propertyName)

Source from the content-addressed store, hash-verified

55
56 protected static final Map<Class<?>, Map<String, Member>> membersCache = new HashMap<Class<?>, Map<String, Member>>();
57 @Override
58 public synchronized Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException {
59 if ( o==null ) {
60 throw new NullPointerException("o");
61 }
62 Class<?> c = o.getClass();
63 if ( property==null ) {
64 return throwNoSuchProperty(c, propertyName, null);
65 }
66 Member member = findMember(c, propertyName);
67 if ( member!=null ) {
68 try {
69 if ( member instanceof Method ) {
70 return ((Method)member).invoke(o);
71 }
72 else if ( member instanceof Field ) {
73 return ((Field)member).get(o);
74 }
75 }
76 catch (Exception e) {
77 throwNoSuchProperty(c, propertyName, e);
78 }
79 }
80 return throwNoSuchProperty(c, propertyName, null);
81 }
82
83 protected static Member findMember(Class<?> clazz, String memberName) {
84 if ( clazz==null ) {

Callers

nothing calls this directly

Calls 4

throwNoSuchPropertyMethod · 0.95
findMemberMethod · 0.95
getMethod · 0.65
invokeMethod · 0.45

Tested by

no test coverage detected