@SuppressWarnings("unchecked") public <T> T newInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException { return newInstance((Class<T>)loadClass(className)); }
@Override public Field getField() { return ((FieldProperty)property).getField(); } }
@Override public Method getSetter() { return ((MethodProperty)property).getSetter(); } }
public Property findSerializableProperty(Class<?> cls, String name) throws SecurityException { List<Property> properties = findSerializableProperties(cls); for (Property property : properties) { if (name.equals(property.getName())) return property; } return null; }
protected Property getDetachedStateProperty(Class<?> entityClass, boolean throwIfNotFound) { checkEntity(entityClass); Property property = reflection.findProperty(entityClass, DETACHED_STATE_FIELD_NAME, String.class); if (property == null && throwIfNotFound) throw new PropertyNotFoundException("No String " + DETACHED_STATE_FIELD_NAME + " property in " + entityClass); return property; }
public List<Property> findSerializableProperties(Class<?> cls) throws SecurityException { ClassDescriptor descriptor = getDescriptor(cls); if (descriptor == null) return Collections.emptyList(); return descriptor.getInheritedSerializableProperties(); }
public ClassDescriptor getDescriptor(Class<?> cls) { if (cls == null || cls == Object.class || !isRegularClass(cls)) return null; ClassDescriptor descriptor = descriptorCache.get(cls); if (descriptor == null) { descriptor = new ClassDescriptor(this, cls); ClassDescriptor previousDescriptor = descriptorCache.putIfAbsent(cls, descriptor); if (previousDescriptor != null) descriptor = previousDescriptor; } return descriptor; }
@Override public String getName() { return property.getName(); }
protected FieldProperty newFieldProperty(Field field) { return new SimpleFieldProperty(field); }
public Platform(ClassLoader reflectionClassLoader) { this(new Reflection(reflectionClassLoader)); }
protected MethodProperty newMethodProperty(Method getter, Method setter, String name) { return new SimpleMethodProperty(getter, setter, name); }
@Override public boolean isReadable() { return property.isReadable(); }
@SuppressWarnings("unchecked") public <T> T newInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException { return newInstance((Class<T>)loadClass(className)); }
protected Property getInitializedProperty(Class<?> entityClass, boolean throwIfNotFound) { checkEntity(entityClass); Property property = reflection.findProperty(entityClass, INITIALIZED_FIELD_NAME, Boolean.TYPE); if (property == null && throwIfNotFound) throw new PropertyNotFoundException("No boolean " + INITIALIZED_FIELD_NAME + " property in " + entityClass); return property; }
public List<Property> findSerializableProperties(Class<?> cls) throws SecurityException { ClassDescriptor descriptor = getDescriptor(cls); if (descriptor == null) return Collections.emptyList(); return descriptor.getInheritedSerializableProperties(); }
public JavaFXFieldProperty(Field field) { super(new SimpleFieldProperty(field)); }
@SuppressWarnings("unchecked") public <T> T newInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException { return newInstance((Class<T>)loadClass(className)); }
protected Property getDetachedStateProperty(Class<?> entityClass, boolean throwIfNotFound) { checkEntity(entityClass); Property property = reflection.findProperty(entityClass, DETACHED_STATE_FIELD_NAME, String.class); if (property == null && throwIfNotFound) throw new PropertyNotFoundException("No String " + DETACHED_STATE_FIELD_NAME + " property in " + entityClass); return property; }
public List<Property> findSerializableProperties(Class<?> cls) throws SecurityException { ClassDescriptor descriptor = getDescriptor(cls); if (descriptor == null) return Collections.emptyList(); return descriptor.getInheritedSerializableProperties(); }
@SuppressWarnings("unchecked") public <T> T newInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException, NoSuchMethodException { return newInstance((Class<T>)loadClass(className)); }