public abstract class AbstractElementAttribute<T> extends Object implements IElementAttribute<T>
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractElementAttribute(String name,
Class<T> type,
boolean optional,
T defaultValue,
IElementAttribute<T> defaultValueAttribute)
Construtor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
getDefaultValue()
Obtém o valor padrão do atributo.
|
IElementAttribute<T> |
getDefaultValueAttribute()
Obtém um outro atributo que servirá de valor padrão para este atributo.
|
String |
getName()
Obtém o nome do atributo.
|
Class<T> |
getType()
Obtém o tipo do atributo.
|
boolean |
isOptional()
Indica se o atributo é opcional.
|
void |
setDefaultValueAttribute(IElementAttribute<T> defaultValueAttribute)
Define um parâmetro que vai determinar valor padrão deste atributo.
|
boolean |
validate(ParsedElement definition)
Valida o atributo de acordo com o elemento lido.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetValueConverterprotected AbstractElementAttribute(String name, Class<T> type, boolean optional, T defaultValue, IElementAttribute<T> defaultValueAttribute)
name - o nome do atributo.type - o tipo do atributo.optional - indicativo de atributo opcional.defaultValue - valor padrão.defaultValueAttribute - atributo com valor padrão.public void setDefaultValueAttribute(IElementAttribute<T> defaultValueAttribute)
defaultValueAttribute - o parâmetro.public IElementAttribute<T> getDefaultValueAttribute()
getDefaultValueAttribute in interface IElementAttribute<T>public String getName()
getName in interface IElementAttribute<T>public Class<T> getType()
getType in interface IElementAttribute<T>public boolean isOptional()
isOptional in interface IElementAttribute<T>public T getDefaultValue()
getDefaultValue in interface IElementAttribute<T>public boolean validate(ParsedElement definition) throws ParseException
validate in interface IElementAttribute<T>definition - o elemento.ParseException - em caso de erro de leitura do XML.Copyright © 2017. All rights reserved.