Top Description Fields Constructors Methods
org.glassfish.pfl.dynamic.codegen.impl

public Class Attribute<T>

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashSet, .List, .Set, org.glassfish.pfl.basic.func.NullaryFunction

Class used to define dynamic attributes on AttributedObject instances. Note that T cannot be a generic type, due to problems with Class<T> when T is a generic. To work around this problem, simply create an interface that extends the generic type (you are programming to interfaces, right?).

Field Summary

Modifier and TypeField and Description
private int
private static List<Attribute<?>>
private Class<T>
private T
private NullaryFunction<T>
initializer

References Deprecated NullaryFunction is deprecated or references (maybe indirectly) at least one deprecated element.
private String

Constructor Summary

AccessConstructor and Description
public
Attribute(Class<T> cls, String name, T defaultValue)

public
Attribute(Class<T> cls, String name, NullaryFunction<T> initializer)
References Deprecated NullaryFunction is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
public static Attribute<?>
get(int index)

public T
public static Set<Attribute<?>>
public int
public boolean
public String
name()

private static synchronized int
next(Attribute<?> attr)

public static int
public void
set(AttributedObject node, T arg)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public Class<?>
type()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

attributeIndexback to summary
private int attributeIndex
attributesback to summary
private static List<Attribute<?>> attributes
clsback to summary
private Class<T> cls
defaultValueback to summary
private T defaultValue
initializerback to summary
private NullaryFunction<T> initializer

References Deprecated

NullaryFunction is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

nameback to summary
private String name

Constructor Detail

Attributeback to summary
public Attribute(Class<T> cls, String name, T defaultValue)
Attributeback to summary
public Attribute(Class<T> cls, String name, NullaryFunction<T> initializer)

References Deprecated

NullaryFunction is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Method Detail

getback to summary
public static Attribute<?> get(int index)
getback to summary
public T get(AttributedObject node)
getAttributesback to summary
public static Set<Attribute<?>> getAttributes(AttributedObject node)
indexback to summary
public int index()
isSetback to summary
public boolean isSet(AttributedObject node)
nameback to summary
public String name()
nextback to summary
private static synchronized int next(Attribute<?> attr)
numberOfAttributesback to summary
public static int numberOfAttributes()
setback to summary
public void set(AttributedObject node, T arg)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

typeback to summary
public Class<?> type()