APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.javafx.fxml.builder

public Class ProxyBuilder<T>

extends AbstractMap<String, Object>
implements Builder<T>
Class Inheritance
All Implemented Interfaces
javafx.util.Builder
Imports
com.sun.javafx.fxml.BeanAdapter, .ModuleHelper, java.lang.annotation.Annotation, java.lang.reflect.Array, .Constructor, .Method, .Modifier, java.util.AbstractMap, .ArrayList, .Collection, .Comparator, .HashMap, .HashSet, .LinkedHashMap, .LinkedList, .List, .Map, .Set, .TreeSet, javafx.beans.NamedArg, javafx.util.Builder, com.sun.javafx.reflect.ConstructorUtil, .ReflectUtil

Using this builder assumes that some of the constructors of desired class with arguments are annotated with NamedArg annotation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private abstract static class
private static class

Field Summary

Modifier and TypeField and Description
private final Comparator<Constructor<T>>
private final Set<Constructor<T>>
private final Map<Constructor<T>, Map<String, ProxyBuilder.AnnotationValue>>
private final Map<String, Object>
private Constructor<T>
private static final Map<Class<?>, Object>
private static final String
private boolean
private final Map<String, ProxyBuilder.Property>
private Set<String>
private static final String
private Class<?>
private final Map<String, Object>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public T
build()

Implements javafx.util.Builder.build.

Builds and returns the object.

private Set<Constructor<T>>
public boolean
containsKey(Object key)

Overrides java.util.AbstractMap.containsKey.

Implements java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public boolean
containsValue(Object value)

Overrides java.util.AbstractMap.containsValue.

Implements java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.

private static Object[]
convertListToArray(Object userValue, Class<?> localType)

private Object
private Object
createObjectFromConstructor(Constructor<T> constructor, Set<String> propertiesToSet)

private Object
private Object
public Set<Map.Entry<String, Object>>
entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public Object
get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

private Set<String>
private static HashMap<String, LinkedList<Method>>
private static Object
private Object
private Object
getTemporaryContainer(String propName)

This is used to support read-only collection property.

private Object
getUserValue(String key, Class<?> type)

public boolean
isEmpty()

Overrides java.util.AbstractMap.isEmpty.

Implements java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.

public Object
put(String key, Object value)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).

private Map<String, ProxyBuilder.Property>
public int
size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.

Inherited from java.util.AbstractMap:
clearcloneequalshashCodekeySetputAllremovetoStringvalues

Field Detail

constructorComparatorback to summary
private final Comparator<Constructor<T>> constructorComparator
constructorsback to summary
private final Set<Constructor<T>> constructors
constructorsMapback to summary
private final Map<Constructor<T>, Map<String, ProxyBuilder.AnnotationValue>> constructorsMap
containersback to summary
private final Map<String, Object> containers
defaultConstructorback to summary
private Constructor<T> defaultConstructor
DEFAULTS_MAPback to summary
private static final Map<Class<?>, Object> DEFAULTS_MAP
GETTER_PREFIXback to summary
private static final String GETTER_PREFIX
hasDefaultConstructorback to summary
private boolean hasDefaultConstructor
propertiesMapback to summary
private final Map<String, ProxyBuilder.Property> propertiesMap
propertyNamesback to summary
private Set<String> propertyNames
SETTER_PREFIXback to summary
private static final String SETTER_PREFIX
typeback to summary
private Class<?> type
userValuesback to summary
private final Map<String, Object> userValues

Constructor Detail

ProxyBuilderback to summary
public ProxyBuilder(Class<?> tp)

Method Detail

buildback to summary
public T build()

Implements javafx.util.Builder.build.

Doc from javafx.util.Builder.build.

Builds and returns the object.

Annotations
@Override
chooseBestConstructorsback to summary
private Set<Constructor<T>> chooseBestConstructors(Set<String> settersArgs)
containsKeyback to summary
public boolean containsKey(Object key)

Overrides java.util.AbstractMap.containsKey.

Implements java.util.Map.containsKey.

Doc from java.util.AbstractMap.containsKey.

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that Objects.equals(key, k). (There can be at most one such mapping.)

Annotations
@Override
containsValueback to summary
public boolean containsValue(Object value)

Overrides java.util.AbstractMap.containsValue.

Implements java.util.Map.containsValue.

Doc from java.util.AbstractMap.containsValue.

Returns true if this map maps one or more keys to the specified value. More formally, returns true if and only if this map contains at least one mapping to a value v such that Objects.equals(value, v). This operation will probably require time linear in the map size for most implementations of the Map interface.

Annotations
@Override
convertListToArrayback to summary
private static Object[] convertListToArray(Object userValue, Class<?> localType)
createInstanceback to summary
private Object createInstance(Constructor<T> c, Object[] args) throws Exception
createObjectFromConstructorback to summary
private Object createObjectFromConstructor(Constructor<T> constructor, Set<String> propertiesToSet)
createObjectFromDefaultConstructorback to summary
private Object createObjectFromDefaultConstructor() throws RuntimeException
createObjectWithExactArgumentsback to summary
private Object createObjectWithExactArguments(Constructor<T> c, Set<String> argumentNames)
entrySetback to summary
public Set<Map.Entry<String, Object>> entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Doc from java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Annotations
@Override
getback to summary
public Object get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Doc from java.util.AbstractMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Annotations
@Override
getArgumentNamesback to summary
private Set<String> getArgumentNames(Constructor<T> c)
getClassMethodCacheback to summary
private static HashMap<String, LinkedList<Method>> getClassMethodCache(Class<?> type)
getDefaultValueback to summary
private static Object getDefaultValue(Class<T> clazz)
getReadOnlyPropertyback to summary
private Object getReadOnlyProperty(String propName)
getTemporaryContainerback to summary
private Object getTemporaryContainer(String propName)

This is used to support read-only collection property. This method must return a Collection of the appropriate type if 1. the property is read-only, and 2. the property is a collection. It must return null otherwise.

getUserValueback to summary
private Object getUserValue(String key, Class<?> type)
isEmptyback to summary
public boolean isEmpty()

Overrides java.util.AbstractMap.isEmpty.

Implements java.util.Map.isEmpty.

Doc from java.util.AbstractMap.isEmpty.

Returns true if this map contains no key-value mappings.

Annotations
@Override
putback to summary
public Object put(String key, Object value)

Overrides java.util.AbstractMap.put.

Implements java.util.Map.put.

Doc from java.util.AbstractMap.put.

Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Annotations
@Override
scanForSettersback to summary
private Map<String, ProxyBuilder.Property> scanForSetters()
sizeback to summary
public int size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Doc from java.util.AbstractMap.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Annotations
@Override
com.sun.javafx.fxml.builder back to summary

private Class ProxyBuilder.AnnotationValue

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
private final String
private final Class<?>

Constructor Summary

AccessConstructor and Description
public
AnnotationValue(String name, String defaultValue, Class<?> type)

Method Summary

Modifier and TypeMethod and Description
public String
public String
public Class<?>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultValueback to summary
private final String defaultValue
nameback to summary
private final String name
typeback to summary
private final Class<?> type

Constructor Detail

AnnotationValueback to summary
public AnnotationValue(String name, String defaultValue, Class<?> type)

Method Detail

getDefaultValueback to summary
public String getDefaultValue()
getNameback to summary
public String getName()
getTypeback to summary
public Class<?> getType()
com.sun.javafx.fxml.builder back to summary

private Class ProxyBuilder.ArrayListWrapper<T>

extends ArrayList<T>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.util.ArrayList:
addaddaddAlladdAlladdFirstaddLastclearclonecontainsensureCapacityequalsforEachgetgetFirstgetLasthashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorremoveremoveremoveAllremoveFirstremoveIfremoveLastremoveRangereplaceAllretainAllsetsizesortspliteratorsubListtoArraytoArraytrimToSize

Constructor Detail

ArrayListWrapperback to summary
private ArrayListWrapper()
com.sun.javafx.fxml.builder back to summary

private Class ProxyBuilder.Getter

extends Property
Class Inheritance

Field Summary

Inherited from com.sun.javafx.fxml.builder.ProxyBuilder.Property:
methodtype

Constructor Summary

AccessConstructor and Description
public
Getter(Method m, Class<?> t)

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from com.sun.javafx.fxml.builder.ProxyBuilder.Property:
getType

Constructor Detail

Getterback to summary
public Getter(Method m, Class<?> t)

Method Detail

invokeback to summary
public void invoke(Object obj, Object argStr) throws Exception

Implements abstract com.sun.javafx.fxml.builder.ProxyBuilder.Property.invoke.

Annotations
@Override
com.sun.javafx.fxml.builder back to summary

private abstract Class ProxyBuilder.Property

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.javafx.fxml.builder.ProxyBuilder.Setter, com.sun.javafx.fxml.builder.ProxyBuilder.Getter

Field Summary

Modifier and TypeField and Description
protected final Method
protected final Class<?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Class<?>
public abstract void
invoke(Object obj, Object argStr)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

methodback to summary
protected final Method method
typeback to summary
protected final Class<?> type

Constructor Detail

Propertyback to summary
public Property(Method m, Class<?> t)

Method Detail

getTypeback to summary
public Class<?> getType()
invokeback to summary
public abstract void invoke(Object obj, Object argStr) throws Exception
com.sun.javafx.fxml.builder back to summary

private Class ProxyBuilder.Setter

extends Property
Class Inheritance

Field Summary

Inherited from com.sun.javafx.fxml.builder.ProxyBuilder.Property:
methodtype

Constructor Summary

AccessConstructor and Description
public
Setter(Method m, Class<?> t)

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from com.sun.javafx.fxml.builder.ProxyBuilder.Property:
getType

Constructor Detail

Setterback to summary
public Setter(Method m, Class<?> t)

Method Detail

invokeback to summary
public void invoke(Object obj, Object argStr) throws Exception

Implements abstract com.sun.javafx.fxml.builder.ProxyBuilder.Property.invoke.

Annotations
@Override