4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager Class Reference

Class attribute manager provides a way how to create new attributes. More...

Collaboration diagram for cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager:
Collaboration graph

Static Public Member Functions

static BaseAttribute createAttribute ()
 
static BaseAttribute createAttribute (String name, String simpleType, Annotation refAnnotation) throws ClassNotFoundException
 
static BaseAttribute createAttribute (String name, String simpleType, Object value, Annotation refAnnotation) throws ClassNotFoundException
 
static BaseAttribute createAttribute (String name, String simpleType, AnnotType attributeType, Object value, Annotation refAnnotation) throws ClassNotFoundException
 
static boolean containsType (String type)
 
static boolean hasAttributeRightInstance (BaseAttribute attr)
 
static BaseAttribute changeAttributeInstance (BaseAttribute attr)
 

Static Package Functions

 [static initializer]
 

Static Private Member Functions

static BaseAttribute createObject (String type) throws ClassNotFoundException
 

Static Private Attributes

static final HashMap< String,
Class > 
mapping = new HashMap<String,Class>()
 

Detailed Description

Class attribute manager provides a way how to create new attributes.

Class attribute manager provides a way how to create new attributes.

Definition at line 26 of file AttributeManager.java.

Member Function Documentation

cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.[static initializer] ( )
staticpackage
static BaseAttribute cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.changeAttributeInstance ( BaseAttribute  attr)
static

Cast the right Attribute class Attention! If simpletype is some bad string, then method returns the same attribute as inserted in parameters!

Parameters
attrquerried nested attribute
Returns
Right class instance

Definition at line 180 of file AttributeManager.java.

Here is the call graph for this function:

static boolean cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.containsType ( String  type)
static

Returns true if String type is correct type of attribute

Parameters
typeType of attribute
Returns
True if it can be created, false if not

Definition at line 153 of file AttributeManager.java.

Here is the caller graph for this function:

static BaseAttribute cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.createAttribute ( )
static

Constructor

Definition at line 31 of file AttributeManager.java.

Here is the caller graph for this function:

static BaseAttribute cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.createAttribute ( String  name,
String  simpleType,
Annotation  refAnnotation 
) throws ClassNotFoundException
static

Creates new empty attribute

Parameters
nameName of attribute
simpleTypeName of simple type of attribute
refAnnotationAnnotation to which this attribute belongs
Returns
Returns new empty attribute

Definition at line 105 of file AttributeManager.java.

Here is the call graph for this function:

static BaseAttribute cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.createAttribute ( String  name,
String  simpleType,
Object  value,
Annotation  refAnnotation 
) throws ClassNotFoundException
static

Creates new attribute

Parameters
nameName of attribute
simpleTypeName of simple type of attribute
valueValue of attribute according to its type. For example, if type is Date then value is expected to be a date.
refAnnotationAnnotation to which this attribute belongs
Returns
Returns new attribute

Definition at line 122 of file AttributeManager.java.

Here is the call graph for this function:

static BaseAttribute cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.createAttribute ( String  name,
String  simpleType,
AnnotType  attributeType,
Object  value,
Annotation  refAnnotation 
) throws ClassNotFoundException
static

Creates a new Attribute with structured type. (For example with nested annotation)

Parameters
nameName of attribute
simpleTypeName of simple type of attribute
attributeTypeStructured type of attribute (type of annotation)
valueNested value. Usually nested annotation
refAnnotationAnnotation to which this attribute belongs
Returns
Returns new attribute of structured type

Definition at line 141 of file AttributeManager.java.

static BaseAttribute cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.createObject ( String  type) throws ClassNotFoundException
staticprivate

Creates a new instance according to type

Parameters
typeType of new instance
Returns
Returns a new instance of appropriate class

Definition at line 86 of file AttributeManager.java.

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.hasAttributeRightInstance ( BaseAttribute  attr)
static

Returns true if attr has the right class instance of it's simpletype

Parameters
attrAttribute for check
Returns
True if simpletype matches the class instance, false otherwise

Definition at line 163 of file AttributeManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

final HashMap<String,Class> cz.vutbr.fit.knot.annotations.entity.attribute.AttributeManager.mapping = new HashMap<String,Class>()
staticprivate

Mapping of types of attributes to classes

Definition at line 36 of file AttributeManager.java.


The documentation for this class was generated from the following file: