public boolean containsKey(String name) { return get(name) != null; }
private MetaProperty getMetaProperty(String name, boolean useStatic) { CachedClass clazz = theCachedClass; SingleKeyHashMap propertyMap; if (useStatic) { propertyMap = staticPropertyIndex; } else { propertyMap = classPropertyIndex.getNullable(clazz); } if (propertyMap == null) { return null; } return (MetaProperty) propertyMap.get(name); }
private static void createMetaBeanProperty(SingleKeyHashMap propertyIndex, String propName, boolean isGetter, MetaMethod propertyMethod) { // is this property already accounted for? MetaProperty mp = (MetaProperty) propertyIndex.get(propName); MetaProperty newMp = makeReplacementMetaProperty(mp, propName, isGetter, propertyMethod); if (newMp!=mp) { propertyIndex.put(propName, newMp); } }
/** * @see MetaObjectProtocol#getMetaProperty(String) */ public MetaProperty getMetaProperty(String name) { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); if (propertyMap.containsKey(name)) { return (MetaProperty) propertyMap.get(name); } else if (staticPropertyIndex.containsKey(name)) { return (MetaProperty) staticPropertyIndex.get(name); } else { propertyMap = classPropertyIndexForSuper.getNotNull(theCachedClass); if (propertyMap.containsKey(name)) return (MetaProperty) propertyMap.get(name); else { CachedClass superClass = theCachedClass; while (superClass != null && superClass != ReflectionCache.OBJECT_CLASS) { final MetaBeanProperty property = findPropertyInClassHierarchy(name, superClass); if (property != null) { onSuperPropertyFoundInHierarchy(property); return property; } superClass = superClass.getCachedSuperClass(); } return null; } } }
private MetaProperty getMetaProperty(Class _clazz, String name, boolean useSuper, boolean useStatic) { if (_clazz == theClass) return getMetaProperty(name, useStatic); CachedClass clazz = ReflectionCache.getCachedClass(_clazz); while (true) { SingleKeyHashMap propertyMap; if (useStatic) { propertyMap = staticPropertyIndex; } else if (useSuper) { propertyMap = classPropertyIndexForSuper.getNullable(clazz); } else { propertyMap = classPropertyIndex.getNullable(clazz); } if (propertyMap == null) { if (clazz != theCachedClass) { clazz = theCachedClass; continue; } else { return null; } } return (MetaProperty) propertyMap.get(name); } }
/** * Adds a new MetaBeanProperty to this MetaClass * * @param mp The MetaBeanProperty */ public void addMetaBeanProperty(MetaBeanProperty mp) { MetaProperty staticProperty = establishStaticMetaProperty(mp); if (staticProperty != null) { staticPropertyIndex.put(mp.getName(), mp); } else { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); //keep field CachedField field; MetaProperty old = (MetaProperty) propertyMap.get(mp.getName()); if (old != null) { if (old instanceof MetaBeanProperty) { field = ((MetaBeanProperty) old).getField(); } else if (old instanceof MultipleSetterProperty) { field = ((MultipleSetterProperty)old).getField(); } else { field = (CachedField) old; } mp.setField(field); } // put it in the list // this will overwrite a possible field property propertyMap.put(mp.getName(), mp); } }
public boolean containsKey(String name) { return get(name) != null; }
public boolean containsKey(String name) { return get(name) != null; }
public boolean containsKey(String name) { return get(name) != null; }
private MetaProperty getMetaProperty(String name, boolean useStatic) { CachedClass clazz = theCachedClass; SingleKeyHashMap propertyMap; if (useStatic) { propertyMap = staticPropertyIndex; } else { propertyMap = classPropertyIndex.getNullable(clazz); } if (propertyMap == null) { return null; } return (MetaProperty) propertyMap.get(name); }
private MetaProperty getMetaProperty(String name, boolean useStatic) { CachedClass clazz = theCachedClass; SingleKeyHashMap propertyMap; if (useStatic) { propertyMap = staticPropertyIndex; } else { propertyMap = classPropertyIndex.getNullable(clazz); } if (propertyMap == null) { return null; } return (MetaProperty) propertyMap.get(name); }
private MetaProperty getMetaProperty(String name, boolean useStatic) { CachedClass clazz = theCachedClass; SingleKeyHashMap propertyMap; if (useStatic) { propertyMap = staticPropertyIndex; } else { propertyMap = classPropertyIndex.getNullable(clazz); } if (propertyMap == null) { return null; } return (MetaProperty) propertyMap.get(name); }
/** * @see MetaObjectProtocol#getMetaProperty(String) */ public MetaProperty getMetaProperty(String name) { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); if (propertyMap.containsKey(name)) { return (MetaProperty) propertyMap.get(name); } else if (staticPropertyIndex.containsKey(name)) { return (MetaProperty) staticPropertyIndex.get(name); } else { propertyMap = classPropertyIndexForSuper.getNotNull(theCachedClass); if (propertyMap.containsKey(name)) return (MetaProperty) propertyMap.get(name); else { CachedClass superClass = theCachedClass; while (superClass != null && superClass != ReflectionCache.OBJECT_CLASS) { final MetaBeanProperty property = findPropertyInClassHierarchy(name, superClass); if (property != null) { onSuperPropertyFoundInHierarchy(property); return property; } superClass = superClass.getCachedSuperClass(); } return null; } } }
/** * @see MetaObjectProtocol#getMetaProperty(String) */ public MetaProperty getMetaProperty(String name) { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); if (propertyMap.containsKey(name)) { return (MetaProperty) propertyMap.get(name); } else if (staticPropertyIndex.containsKey(name)) { return (MetaProperty) staticPropertyIndex.get(name); } else { propertyMap = classPropertyIndexForSuper.getNotNull(theCachedClass); if (propertyMap.containsKey(name)) return (MetaProperty) propertyMap.get(name); else { CachedClass superClass = theCachedClass; while (superClass != null && superClass != ReflectionCache.OBJECT_CLASS) { final MetaBeanProperty property = findPropertyInClassHierarchy(name, superClass); if (property != null) { onSuperPropertyFoundInHierarchy(property); return property; } superClass = superClass.getCachedSuperClass(); } return null; } } }
/** * @see MetaObjectProtocol#getMetaProperty(String) */ public MetaProperty getMetaProperty(String name) { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); if (propertyMap.containsKey(name)) { return (MetaProperty) propertyMap.get(name); } else if (staticPropertyIndex.containsKey(name)) { return (MetaProperty) staticPropertyIndex.get(name); } else { propertyMap = classPropertyIndexForSuper.getNotNull(theCachedClass); if (propertyMap.containsKey(name)) return (MetaProperty) propertyMap.get(name); else { CachedClass superClass = theCachedClass; while(superClass != null && superClass != ReflectionCache.OBJECT_CLASS) { final MetaBeanProperty property = findPropertyInClassHierarchy(name, superClass); if(property != null) { onSuperPropertyFoundInHierarchy(property); return property; } superClass = superClass.getCachedSuperClass(); } return null; } } }
private MetaProperty getMetaProperty(Class _clazz, String name, boolean useSuper, boolean useStatic) { if (_clazz == theClass) return getMetaProperty(name, useStatic); CachedClass clazz = ReflectionCache.getCachedClass(_clazz); while (true) { SingleKeyHashMap propertyMap; if (useStatic) { propertyMap = staticPropertyIndex; } else if (useSuper) { propertyMap = classPropertyIndexForSuper.getNullable(clazz); } else { propertyMap = classPropertyIndex.getNullable(clazz); } if (propertyMap == null) { if (clazz != theCachedClass) { clazz = theCachedClass; continue; } else { return null; } } return (MetaProperty) propertyMap.get(name); } }
private MetaProperty getMetaProperty(Class _clazz, String name, boolean useSuper, boolean useStatic) { if (_clazz == theClass) return getMetaProperty(name, useStatic); CachedClass clazz = ReflectionCache.getCachedClass(_clazz); while (true) { SingleKeyHashMap propertyMap; if (useStatic) { propertyMap = staticPropertyIndex; } else if (useSuper) { propertyMap = classPropertyIndexForSuper.getNullable(clazz); } else { propertyMap = classPropertyIndex.getNullable(clazz); } if (propertyMap == null) { if (clazz != theCachedClass) { clazz = theCachedClass; continue; } else { return null; } } return (MetaProperty) propertyMap.get(name); } }
private MetaProperty getMetaProperty(Class _clazz, String name, boolean useSuper, boolean useStatic) { if (_clazz == theClass) return getMetaProperty(name, useStatic); CachedClass clazz = ReflectionCache.getCachedClass(_clazz); while (true) { SingleKeyHashMap propertyMap; if (useStatic) { propertyMap = staticPropertyIndex; } else if (useSuper) { propertyMap = classPropertyIndexForSuper.getNullable(clazz); } else { propertyMap = classPropertyIndex.getNullable(clazz); } if (propertyMap == null) { if (clazz != theCachedClass) { clazz = theCachedClass; continue; } else { return null; } } return (MetaProperty) propertyMap.get(name); } }
/** * Adds a new MetaBeanProperty to this MetaClass * * @param mp The MetaBeanProperty */ public void addMetaBeanProperty(MetaBeanProperty mp) { MetaProperty staticProperty = establishStaticMetaProperty(mp); if (staticProperty != null) { staticPropertyIndex.put(mp.getName(), mp); } else { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); //keep field CachedField field; MetaProperty old = (MetaProperty) propertyMap.get(mp.getName()); if (old != null) { if (old instanceof MetaBeanProperty) { field = ((MetaBeanProperty) old).getField(); } else { field = (CachedField) old; } mp.setField(field); } // put it in the list // this will overwrite a possible field property propertyMap.put(mp.getName(), mp); } }
/** * Adds a new MetaBeanProperty to this MetaClass * * @param mp The MetaBeanProperty */ public void addMetaBeanProperty(MetaBeanProperty mp) { MetaProperty staticProperty = establishStaticMetaProperty(mp); if (staticProperty != null) { staticPropertyIndex.put(mp.getName(), mp); } else { SingleKeyHashMap propertyMap = classPropertyIndex.getNotNull(theCachedClass); //keep field CachedField field; MetaProperty old = (MetaProperty) propertyMap.get(mp.getName()); if (old != null) { if (old instanceof MetaBeanProperty) { field = ((MetaBeanProperty) old).getField(); } else { field = (CachedField) old; } mp.setField(field); } // put it in the list // this will overwrite a possible field property propertyMap.put(mp.getName(), mp); } }