public abstract class AttributeImpl<T> extends Object implements Attribute<T>
Base class for implementing primitive value attributes
Modifier and Type | Method and Description |
---|---|
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 |
setValue(ModelElementInstance modelElement,
T value,
boolean withReferenceUpdate)
sets the value of the attribute.
|
void |
unlinkReference(ModelElementInstance modelElement,
Object referenceIdentifier) |
void |
updateIncomingReferences(ModelElementInstance modelElement,
String newIdentifier,
String oldIdentifier) |
protected abstract T convertXmlValueToModelValue(String rawValue)
protected abstract String convertModelValueToXmlValue(T modelValue)
public ModelElementType getOwningElementType()
getOwningElementType
in interface Attribute<T>
public T getValue(ModelElementInstance modelElement)
public void setValue(ModelElementInstance modelElement, T value)
public void setValue(ModelElementInstance modelElement, T value, boolean withReferenceUpdate)
Attribute
public void updateIncomingReferences(ModelElementInstance modelElement, String newIdentifier, String oldIdentifier)
public T getDefaultValue()
getDefaultValue
in interface Attribute<T>
public void setDefaultValue(T defaultValue)
public boolean isRequired()
isRequired
in interface Attribute<T>
public void setRequired(boolean required)
public void setNamespaceUri(String namespaceUri)
namespaceUri
- the namespaceUri to setpublic String getNamespaceUri()
getNamespaceUri
in interface Attribute<T>
public boolean isIdAttribute()
isIdAttribute
in interface Attribute<T>
public void setId()
public String getAttributeName()
getAttributeName
in interface Attribute<T>
public void setAttributeName(String attributeName)
attributeName
- the attributeName to setpublic void removeAttribute(ModelElementInstance modelElement)
public void unlinkReference(ModelElementInstance modelElement, Object referenceIdentifier)
public List<Reference<?>> getIncomingReferences()
getIncomingReferences
in interface Attribute<T>
public List<Reference<?>> getOutgoingReferences()
getOutgoingReferences
in interface Attribute<T>
public void registerOutgoingReference(Reference<?> ref)
public void registerIncoming(Reference<?> ref)
Copyright © 2019. All rights reserved.