1 4 package com.tc.aspectwerkz.reflect; 5 6 11 public class MetaDataInspector { 12 19 public static boolean hasField(final ClassInfo classInfo, final String fieldName) { 20 for (int i = 0; i < classInfo.getFields().length; i++) { 21 FieldInfo fieldMetaData = classInfo.getFields()[i]; 22 if (fieldMetaData.getName().equals(fieldName)) { 23 return true; 24 } 25 } 26 return false; 27 } 28 29 36 public static boolean hasInterface(final ClassInfo classInfo, final String interfaceName) { 37 for (int i = 0; i < classInfo.getInterfaces().length; i++) { 38 ClassInfo interfaceMetaData = classInfo.getInterfaces()[i]; 39 if (interfaceMetaData.getName().equals(interfaceName)) { 40 return true; 41 } 42 } 43 return false; 44 } 45 } | Popular Tags |