From f5f6d341359bf99809ca487c8cd2d6564a8d352b Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 21 Feb 2022 18:19:51 +0100 Subject: [PATCH] dcc --- .../atriasoft/exml/annotation/XmlFactory.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/org/atriasoft/exml/annotation/XmlFactory.java diff --git a/src/org/atriasoft/exml/annotation/XmlFactory.java b/src/org/atriasoft/exml/annotation/XmlFactory.java new file mode 100644 index 0000000..b909183 --- /dev/null +++ b/src/org/atriasoft/exml/annotation/XmlFactory.java @@ -0,0 +1,37 @@ +package org.atriasoft.exml.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marker annotation that permit to set the default parsing as attributes. + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@ExmlAnnotation +public @interface XmlFactory { + public interface InterfaceXmlFactoryAccess { + /** + * Find the class type with the specific name. + * @param name Name of the node to find. + * @return Value of the class interface to create or null. + */ + Class findClass(String name); + + /** + * Retrieve the name of the node in xml for the specific Object. + * @param object The object that we need to find the type name. + * @return The xml string to inject (or null). + */ + String generateName(Object object); + } + + /** + * Set this to false to select the attribute as default. + * @return true select default attribute, false select default element. + */ + Class value(); + +}