1 8 package org.codehaus.aspectwerkz.reflect; 9 10 15 public class MetaDataInspector { 16 23 public static boolean hasField(final ClassInfo classInfo, final String fieldName) { 24 for (int i = 0; i < classInfo.getFields().length; i++) { 25 FieldInfo fieldMetaData = classInfo.getFields()[i]; 26 if (fieldMetaData.getName().equals(fieldName)) { 27 return true; 28 } 29 } 30 return false; 31 } 32 33 40 public static boolean hasInterface(final ClassInfo classInfo, final String interfaceName) { 41 for (int i = 0; i < classInfo.getInterfaces().length; i++) { 42 ClassInfo interfaceMetaData = classInfo.getInterfaces()[i]; 43 if (interfaceMetaData.getName().equals(interfaceName)) { 44 return true; 45 } 46 } 47 return false; 48 } 49 } | Popular Tags |