org.camunda.bpm.model.xml.impl.type.attribute
Class AttributeImpl<T>

java.lang.Object
  extended by org.camunda.bpm.model.xml.impl.type.attribute.AttributeImpl<T>
All Implemented Interfaces:
Attribute<T>
Direct Known Subclasses:
BooleanAttribute, DoubleAttribute, EnumAttribute, IntegerAttribute, StringAttribute

public abstract class AttributeImpl<T>
extends Object
implements Attribute<T>

Base class for implementing primitive value attributes

Author:
Daniel Meyer

Method Summary
protected abstract  String convertModelValueToXmlValue(T modelValue)
          to be implemented by subclasses: converts the raw (String) value of the attribute to the type required by the model
protected abstract  T convertXmlValueToModelValue(String rawValue)
          to be implemented by subclasses: converts the raw (String) value of the attribute to the type required by the model
 String getAttributeName()
           
 T getDefaultValue()
           
 List<Reference<?>> getIncomingReferences()
           
 String getNamespaceUri()
           
 List<Reference<?>> getOutgoingReferences()
           
 ModelElementType getOwningElementType()
           
 T getValue(ModelElementInstance modelElement)
          returns the value of the attribute.
 boolean isIdAttribute()
           
 boolean isRequired()
           
 void registerIncoming(Reference<?> ref)
           
 void registerOutgoingReference(Reference<?> ref)
           
 void removeAttribute(ModelElementInstance modelElement)
           
 void setAttributeName(String attributeName)
           
 void setDefaultValue(T defaultValue)
           
 void setId()
          Indicate whether this attribute is an Id attribute
 void setNamespaceUri(String namespaceUri)
           
 void setRequired(boolean required)
           
 void setValue(ModelElementInstance modelElement, T value)
          sets the value of the attribute.
 void unlinkReference(ModelElementInstance modelElement, Object referenceIdentifier)
           
 void updateIncomingReferences(ModelElementInstance modelElement, String newIdentifier, String oldIdentifier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertXmlValueToModelValue

protected abstract T convertXmlValueToModelValue(String rawValue)
to be implemented by subclasses: converts the raw (String) value of the attribute to the type required by the model

Returns:
the converted value

convertModelValueToXmlValue

protected abstract String convertModelValueToXmlValue(T modelValue)
to be implemented by subclasses: converts the raw (String) value of the attribute to the type required by the model

Returns:
the converted value

getOwningElementType

public ModelElementType getOwningElementType()
Specified by:
getOwningElementType in interface Attribute<T>

getValue

public T getValue(ModelElementInstance modelElement)
returns the value of the attribute.

Specified by:
getValue in interface Attribute<T>
Returns:
the value of the attribute.

setValue

public void setValue(ModelElementInstance modelElement,
                     T value)
sets the value of the attribute. the value of the attribute.

Specified by:
setValue in interface Attribute<T>

updateIncomingReferences

public void updateIncomingReferences(ModelElementInstance modelElement,
                                     String newIdentifier,
                                     String oldIdentifier)

getDefaultValue

public T getDefaultValue()
Specified by:
getDefaultValue in interface Attribute<T>

setDefaultValue

public void setDefaultValue(T defaultValue)

isRequired

public boolean isRequired()
Specified by:
isRequired in interface Attribute<T>

setRequired

public void setRequired(boolean required)

setNamespaceUri

public void setNamespaceUri(String namespaceUri)
Parameters:
namespaceUri - the namespaceUri to set

getNamespaceUri

public String getNamespaceUri()
Specified by:
getNamespaceUri in interface Attribute<T>
Returns:
the namespaceUri

isIdAttribute

public boolean isIdAttribute()
Specified by:
isIdAttribute in interface Attribute<T>

setId

public void setId()
Indicate whether this attribute is an Id attribute


getAttributeName

public String getAttributeName()
Specified by:
getAttributeName in interface Attribute<T>
Returns:
the attributeName

setAttributeName

public void setAttributeName(String attributeName)
Parameters:
attributeName - the attributeName to set

removeAttribute

public void removeAttribute(ModelElementInstance modelElement)

unlinkReference

public void unlinkReference(ModelElementInstance modelElement,
                            Object referenceIdentifier)

getIncomingReferences

public List<Reference<?>> getIncomingReferences()
Specified by:
getIncomingReferences in interface Attribute<T>
Returns:
the incomingReferences

getOutgoingReferences

public List<Reference<?>> getOutgoingReferences()
Specified by:
getOutgoingReferences in interface Attribute<T>
Returns:
the outgoingReferences

registerOutgoingReference

public void registerOutgoingReference(Reference<?> ref)

registerIncoming

public void registerIncoming(Reference<?> ref)


Copyright © 2015 camunda services GmbH. All rights reserved.