Class ObjectXML

  • All Implemented Interfaces:
    java.io.Serializable

    public class ObjectXML
    extends java.lang.Object
    implements java.io.Serializable

    Simplicite XML object manager

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectXML()  
      ObjectXML​(ObjectDB obj, java.lang.String action, boolean timestampField, boolean inlineDocs)  
      ObjectXML​(ObjectDB obj, java.lang.String action, boolean timestampField, boolean patchMode, boolean functKeysOnly, boolean inlineDocs)
      Construct a XML structure
      ObjectXML​(java.lang.String name, java.lang.String action)  
      ObjectXML​(java.lang.String name, java.lang.String action, java.lang.String mode)  
    • Method Summary

      Modifier and Type Method Description
      void addData​(DataXML data)
      Add data
      void addData​(java.lang.String[] tags, java.lang.String[] values)
      Add data
      void addData​(java.util.List<java.lang.String> tags, java.util.List<java.lang.Object> values)
      Add data
      void addData​(java.util.Map<java.lang.String,​java.lang.Object> data)
      Add data
      void addDataList​(java.util.List<DataXML> datas)
      Add data
      java.util.Map<java.lang.String,​java.lang.String> attachTo​(java.lang.String root, java.util.Map<java.lang.String,​java.lang.String> files)  
      void clearData()
      Clear data
      java.lang.String getAction()
      Action ObjectXML.ACTION_*
      java.util.List<DataXML> getData()
      XML datas
      DataXML getData​(int i)
      XML data at position
      java.lang.String getIfExists()
      If exists property
      java.lang.String getLabel()  
      java.lang.String getMode()
      Query ObjectXML.MODE_*
      java.lang.String getName()
      Object name
      boolean isOld()
      Is old object ?
      ObjectDB loadObject​(Grant g)
      Load XML data into the temporary instance.
      void setAction​(java.lang.String action)  
      void setIfExists​(java.lang.String ifexists)  
      void setLabel​(java.lang.String label)  
      void setMode​(java.lang.String mode)  
      void setName​(java.lang.String name)  
      void setOld​(boolean old)  
      java.lang.StringBuilder toJSON()  
      java.lang.String toString()  
      java.lang.StringBuilder toXML()  
      java.lang.StringBuilder toXML​(java.lang.String tab, java.lang.String spacer)  
      ObjectXML undoXML​(ObjectDB obj, java.lang.String action)
      Build the undo changes of action
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ObjectXML

        public ObjectXML()
      • ObjectXML

        public ObjectXML​(java.lang.String name,
                         java.lang.String action)
      • ObjectXML

        public ObjectXML​(java.lang.String name,
                         java.lang.String action,
                         java.lang.String mode)
      • ObjectXML

        public ObjectXML​(ObjectDB obj,
                         java.lang.String action,
                         boolean timestampField,
                         boolean inlineDocs)
      • ObjectXML

        public ObjectXML​(ObjectDB obj,
                         java.lang.String action,
                         boolean timestampField,
                         boolean patchMode,
                         boolean functKeysOnly,
                         boolean inlineDocs)
        Construct a XML structure
        Parameters:
        obj - Object to export
        action - Optional action
        timestampField - Export timestamp fields ?
        patchMode - Patch mode to export only changed fields ?
        functKeysOnly - Export only functional keys ?
        inlineDocs - Inline docs/images in XML ?
    • Method Detail

      • setName

        public void setName​(java.lang.String name)
      • setAction

        public void setAction​(java.lang.String action)
      • setMode

        public void setMode​(java.lang.String mode)
      • setIfExists

        public void setIfExists​(java.lang.String ifexists)
      • setOld

        public void setOld​(boolean old)
      • getName

        public java.lang.String getName()
        Object name
      • getAction

        public java.lang.String getAction()
        Action ObjectXML.ACTION_*
      • getIfExists

        public java.lang.String getIfExists()
        If exists property
      • isOld

        public boolean isOld()
        Is old object ?
      • getMode

        public java.lang.String getMode()
        Query ObjectXML.MODE_*
      • getData

        public java.util.List<DataXML> getData()
        XML datas
      • getData

        public DataXML getData​(int i)
        XML data at position
      • setLabel

        public void setLabel​(java.lang.String label)
      • getLabel

        public java.lang.String getLabel()
      • clearData

        public void clearData()
        Clear data
      • addData

        public void addData​(DataXML data)
        Add data
      • addData

        public void addData​(java.lang.String[] tags,
                            java.lang.String[] values)
        Add data
      • addDataList

        public void addDataList​(java.util.List<DataXML> datas)
        Add data
      • addData

        public void addData​(java.util.List<java.lang.String> tags,
                            java.util.List<java.lang.Object> values)
        Add data
      • addData

        public void addData​(java.util.Map<java.lang.String,​java.lang.Object> data)
        Add data
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toXML

        public java.lang.StringBuilder toXML()
      • toXML

        public java.lang.StringBuilder toXML​(java.lang.String tab,
                                             java.lang.String spacer)
      • toJSON

        public java.lang.StringBuilder toJSON()
      • attachTo

        public java.util.Map<java.lang.String,​java.lang.String> attachTo​(java.lang.String root,
                                                                               java.util.Map<java.lang.String,​java.lang.String> files)
      • undoXML

        public ObjectXML undoXML​(ObjectDB obj,
                                 java.lang.String action)
        Build the undo changes of action
      • loadObject

        public ObjectDB loadObject​(Grant g)
        Load XML data into the temporary instance. First DataXML is loaded in object fields, all DataXML are loaded in the current list.
        Parameters:
        g - User rights
        Returns:
        Temporary object representing the ObjectXML