TAttribute - the type of the content that is stored.public abstract class AttributeHolder<TAttribute extends AttributeWrapper> extends Object
Map of String and AttributeWrapper. Its main purpose is to handle the splitting and storage of
data which is represented by a key and has a certain content, where as the content is described as the TAttribute.| Constructor and Description |
|---|
AttributeHolder() |
| Modifier and Type | Method and Description |
|---|---|
abstract TAttribute |
createAttributeType(String name)
This method is used each time a new
AttributeWrapper is needed. |
Optional<TAttribute> |
getAttribute(String name)
Returns the
TAttribute in attributes using the provided key or null if no such content type exist. |
<TContent extends TAttribute> |
getAttribute(String name,
Class<TContent> clazz)
Returns the
TAttribute in the attributes as the desired type using the provided key or null if no such content type exist. |
<TContent extends TAttribute> |
getAttributeOrFail(String name,
Class<TContent> clazz)
Returns the
TAttribute in the attributes as the desired type using the provided key or throws an IllegalArgumentException of the attribute does not exit. |
Map<String,TAttribute> |
getAttributes()
Returns the
attributes. |
public abstract TAttribute createAttributeType(String name)
AttributeWrapper is needed.name - the name of the content type to be created.TAttribute for the given name.public final Map<String,TAttribute> getAttributes()
attributes.attributes.public final Optional<TAttribute> getAttribute(String name)
TAttribute in attributes using the provided key or null if no such content type exist.name - name of the content.Optional containing the attribute or Optional.EMPTY if the desired attribute does not exist.public final <TContent extends TAttribute> Optional<TContent> getAttribute(String name, Class<TContent> clazz)
TAttribute in the attributes as the desired type using the provided key or null if no such content type exist.TContent - type of the content desired.name - name of the propertyclazz - class of the type of the property used for casting.Optional containing the attribute or Optional.EMPTY if the desired attribute does not exist.public final <TContent extends TAttribute> TContent getAttributeOrFail(String name, Class<TContent> clazz) throws SVGException
TAttribute in the attributes as the desired type using the provided key or throws an IllegalArgumentException of the attribute does not exit.TContent - type of the content desired.name - name of the propertyclazz - class of the type of the property used for casting.TAttribute.SVGException - if the desired attribute does not exist.Copyright © 2016 Saxonia Systems AG. All rights reserved.