pt.digitalis.dif.dem
Enum Entity

java.lang.Object
  extended by java.lang.Enum<Entity>
      extended by pt.digitalis.dif.dem.Entity
All Implemented Interfaces:
Serializable, Comparable<Entity>

public enum Entity
extends Enum<Entity>

Defines the known entity types to the framework.

Author:
Rodrigo Gonçalves rgoncalves@digitalis.pt, Pedro Viegas pviegas@digitalis.pt
Created on:
2007/09/13

Enum Constant Summary
APPLICATION
          A @ApplicationDefinition annotated Entity.
PROVIDER
          A @ProviderDefinition annotated Entity.
SERVICE
          A @ServiceDefinition annotated Entity.
STAGE
          A @StageDefinition annotated Entity.
VALIDATOR
          A @ValidatorDefinition annotated Entity.
 
Method Summary
static Entity getEntityTypeFromClass(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
          Returns the Entity type of annotated class, null if no valid entity annotation is found.
 String getFullyQualifiedName()
          Returns the Entity's FQN.
static String getID(Entity type, String id)
          The ID builder utility method.
 String getName()
          Returns the Entity's name.
static Entity valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Entity[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

VALIDATOR

public static final Entity VALIDATOR
A @ValidatorDefinition annotated Entity.


PROVIDER

public static final Entity PROVIDER
A @ProviderDefinition annotated Entity.


APPLICATION

public static final Entity APPLICATION
A @ApplicationDefinition annotated Entity.


SERVICE

public static final Entity SERVICE
A @ServiceDefinition annotated Entity.


STAGE

public static final Entity STAGE
A @StageDefinition annotated Entity.

Method Detail

values

public static Entity[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Entity c : Entity.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Entity valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getFullyQualifiedName

public String getFullyQualifiedName()
Returns the Entity's FQN.

Returns:
the Entity's FQN.

getName

public String getName()
Returns the Entity's name.

Returns:
the Entity's name.

getID

public static String getID(Entity type,
                           String id)
The ID builder utility method.

Parameters:
type - the type of the entity
id - the id of the entity
Returns:
the compiled unique id for the given entity

getEntityTypeFromClass

public static Entity getEntityTypeFromClass(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
                                     throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException
Returns the Entity type of annotated class, null if no valid entity annotation is found.

Parameters:
clazz - the class to inspect
Returns:
the entity type, null if no valid entity annotation is found.
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if the class annotations can't be read


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.