canguru.descriptor
Class Element

java.lang.Object
  |
  +--canguru.descriptor.Element

public class Element
extends java.lang.Object


Field Summary
private  java.util.Map attributes
           
private  java.lang.Long id
           
private  byte[] serializedForm
           
private  AttributeType serializedType
           
 
Constructor Summary
(package private) Element(java.lang.Long id)
          Cria um novo elemento
 
Method Summary
(package private)  void addAttribute(java.lang.String attributeName, AttributeType type, java.lang.Long attributeId, java.lang.Object attributeValue)
          Adiciona um atributo ao elemento.
 Attribute getAttribute(java.lang.String attributeName)
          Retorna um atributo pelo nome
 java.util.Map getAttributes()
          Retorna um Map com os atributos do elemento
 java.lang.Long getId()
          Retorna o id do elemento
 byte[] getSerializedForm()
          Retorna a forma serializada do elemento
 AttributeType getSerializedType()
          Retorna o tipo da forma serializada do elemento
(package private)  void setSerializedForm(byte[] serializedForm)
          Registra forma serializada do elemento
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private java.lang.Long id

attributes

private java.util.Map attributes

serializedForm

private byte[] serializedForm

serializedType

private AttributeType serializedType
Constructor Detail

Element

Element(java.lang.Long id)
Cria um novo elemento

Parameters:
id - id do elemento
Method Detail

addAttribute

void addAttribute(java.lang.String attributeName,
                  AttributeType type,
                  java.lang.Long attributeId,
                  java.lang.Object attributeValue)
            throws InvalidNameException,
                   InvalidAttributeException
Adiciona um atributo ao elemento. Lança uma exceção caso não seja um atributo válido.

Parameters:
type - tipo do atributo
Throws:
InvalidNameException
InvalidAttributeException

setSerializedForm

void setSerializedForm(byte[] serializedForm)
Registra forma serializada do elemento

Parameters:
serializedForm - forma serializada do elemento

getId

public java.lang.Long getId()
Retorna o id do elemento

Returns:
id do elemento

getAttribute

public Attribute getAttribute(java.lang.String attributeName)
                       throws AttributeNotFoundException
Retorna um atributo pelo nome

Parameters:
attributeName - nome do atributo
AttributeNotFoundException

getAttributes

public java.util.Map getAttributes()
Retorna um Map com os atributos do elemento

Returns:

getSerializedForm

public byte[] getSerializedForm()
Retorna a forma serializada do elemento

Returns:
forma serializada do elemento

getSerializedType

public AttributeType getSerializedType()
Retorna o tipo da forma serializada do elemento

Returns:
tipo da forma serializada do elemento