package silly.test; import org.xeril.xml.*; public class Ex2 { private int _hidden = -1; private float _fl; private Class[] _classes; /** * This constructor is required by the XML package */ public Ex2() { } /** * Inner class to define the xml behavior */ public static class XmlInfo extends SimpleXmlInfo { /** * The date mapper */ private static XmlMapperClass mapperClass = new XmlMapperClass(); private static XmlMapDescriptor[] descs = { hide("_hidden"), rename("_fl", "fl"), setIndexedMapper("_classes", "classes", mapperClass) }; /** * You can associate a map descriptor with each field of your * object. Basically a map descriptor is used to "map" a field name to * an XML tag. It is also used to map a type. * * @return an array of map descriptors * @see XmlMapDescriptor */ public XmlMapDescriptor[] getXmlMapDescriptors() { return descs; } /** * Returns the xml name that will be used. It's probably not very nice * to have the tag name of an object to be the name of its class, thus * this method allows you to override this default. The default * implementation is to return "". * * @return the xml name of this class */ public String getXmlName() { return "Ex2"; } } }