This commit is contained in:
Edouard DUPIN 2022-02-21 18:19:51 +01:00
parent 24d9099a85
commit f5f6d34135

View File

@ -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();
}