public abstract class XMLElementFactory extends Object implements XMLElementFactoryInterface
| Modifier | Constructor and Description |
|---|---|
protected |
XMLElementFactory()
Construtor protegido.
|
| Modifier and Type | Method and Description |
|---|---|
XMLElementInterface |
createXMLElementFromApp(Object appObject)
Cria um elemento XML a partir de um objeto da aplicação.
|
XMLElementInterface |
createXMLElementFromTag(String tagName)
Cria um elemento XML a partir de uma tag.
|
protected abstract void |
fillConversionTables()
Preenche as tabelas de conversão de tag para nome de classe.
|
protected abstract Map<Class<?>,String> |
getAppObjectToTagMap()
Retorna o mapeamento de objetos da aplicação para tags.
|
protected abstract Map<String,Class<? extends XMLElementInterface>> |
getTagToXMLMap()
Retorna o mapeamento de tags para elementos XML.
|
void |
mapAppClassToTag(Class<?> cls,
String tagName)
Associa uma classe da aplicação a uma tag.
|
void |
mapAppClassToTag(String className,
String tagName)
Deprecated.
|
void |
mapTagToXMLClass(String tagName,
Class<? extends XMLElementInterface> cls)
Associa uma tag a uma classe que representa o elemnto XML correspondente.
|
void |
mapTagToXMLClass(String tagName,
String className)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAppContextObject, setAppContextObjectpublic XMLElementInterface createXMLElementFromTag(String tagName)
tagNamesToXMLClasses, preenchido pelo método
fillConversionTables para obter o nome da classe associada à
tag.
Este método tipicamente não precisa ser redefinido, basta implementar o
método abstrato fillConversionTables.createXMLElementFromTag in interface XMLElementFactoryInterfacetagName - nome da tagXMLInternalErrorException - nos casos:
XMLElementFactoryInterface.createXMLElementFromTag(java.lang.String)public XMLElementInterface createXMLElementFromApp(Object appObject)
appClassesToTags, preenchido pelo método
fillConversionTables para obter o nome da tag associada ao
objeto.fillConversionTables.createXMLElementFromApp in interface XMLElementFactoryInterfaceappObject - objeto raiz da aplicacao.XMLElementFactoryInterface.createXMLElementFromApp(java.lang.Object)@Deprecated public final void mapTagToXMLClass(String tagName, String className)
mapTagToXMLClass(String, Class)className - nome da classetagName - nome da tagXMLInternalErrorException - se a tag é nula, se o nome da classe é
nulo ou se já existe mapeamento para a tagpublic final void mapTagToXMLClass(String tagName, Class<? extends XMLElementInterface> cls)
tagName - nome da tagcls - classeXMLInternalErrorException - se a tag é nula, se a classe é nula ou se
já existe mapeamento para a tag@Deprecated public final void mapAppClassToTag(String className, String tagName)
mapAppClassToTag(Class, String)className - nome da classetagName - nome da tagpublic final void mapAppClassToTag(Class<?> cls, String tagName)
cls - a classetagName - nome da tagprotected abstract void fillConversionTables()
mapAppClassToTagmapTagToXMLClassprotected abstract Map<String,Class<? extends XMLElementInterface>> getTagToXMLMap()
protected abstract Map<Class<?>,String> getAppObjectToTagMap()
Copyright © 2016 Tecgraf/PUC-Rio. All rights reserved.