Class PnmlElement

    • Constructor Summary

      Constructors 
      Constructor Description
      PnmlElement​(java.lang.String tag)
      Creates a fresh PNML element.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkValidity​(Pnml pnml)
      Default check for validity: No action.
      protected java.lang.String exportAttribute​(java.lang.String tag, java.lang.String value, Pnml pnml)
      Default way to export some attribute.
      protected java.lang.String exportAttributes​(Pnml pnml)
      Exports all standard attributes: None.
      java.lang.String exportElement​(Pnml pnml)
      Exports the element.
      protected java.lang.String exportElements​(Pnml pnml)
      Exports all standard elements: None.
      protected void importAttributes​(org.xmlpull.v1.XmlPullParser xpp, Pnml pnml)
      Imports all standard attributes: None.
      void importElement​(org.xmlpull.v1.XmlPullParser xpp, Pnml pnml)
      Imports the given element.
      protected boolean importElements​(org.xmlpull.v1.XmlPullParser xpp, Pnml pnml)
      Imports all standard child elements: None.
      protected void importText​(java.lang.String text, Pnml pnml)
      Imports standard text: No action.
      static void setFactory​(PnmlElementFactory factory)
      When changing the factory for the purpose of exporting with non-default pnml, please make sure no other thread can change the factory during export.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tag

        public java.lang.String tag
        The PNML tag for this element.
      • lineNumber

        public int lineNumber
    • Constructor Detail

      • PnmlElement

        public PnmlElement​(java.lang.String tag)
        Creates a fresh PNML element.
        Parameters:
        tag -
    • Method Detail

      • setFactory

        public static void setFactory​(PnmlElementFactory factory)
        When changing the factory for the purpose of exporting with non-default pnml, please make sure no other thread can change the factory during export. The Pnml convertFrom and convertTo methods synchronize on this factory, so in order to make sure no other thread can change the factory, it is best to synchronize on factory before setting it, until completed with import or export.
        Parameters:
        factory -
      • importElement

        public void importElement​(org.xmlpull.v1.XmlPullParser xpp,
                                  Pnml pnml)
        Imports the given element.
        Parameters:
        xpp -
        pnml -
      • exportElement

        public java.lang.String exportElement​(Pnml pnml)
        Exports the element.
        Returns:
      • importAttributes

        protected void importAttributes​(org.xmlpull.v1.XmlPullParser xpp,
                                        Pnml pnml)
        Imports all standard attributes: None. If some subclass has attributes, this method needs to be overruled by it.
        Parameters:
        xpp -
        pnml -
      • exportAttributes

        protected java.lang.String exportAttributes​(Pnml pnml)
        Exports all standard attributes: None. If some subclass has attributes, this method needs to be overruled by it.
        Returns:
      • importElements

        protected boolean importElements​(org.xmlpull.v1.XmlPullParser xpp,
                                         Pnml pnml)
        Imports all standard child elements: None. If some subclass has child elements, this method needs to be overruled by it.
        Parameters:
        xpp -
        pnml -
        Returns:
      • exportElements

        protected java.lang.String exportElements​(Pnml pnml)
        Exports all standard elements: None. If some subclass has child elements, this method needs to be overruled by it.
        Returns:
      • importText

        protected void importText​(java.lang.String text,
                                  Pnml pnml)
        Imports standard text: No action. If some subclass needs to import text, this method needs to be overruled by it.
        Parameters:
        text -
        pnml -
      • exportAttribute

        protected java.lang.String exportAttribute​(java.lang.String tag,
                                                   java.lang.String value,
                                                   Pnml pnml)
        Default way to export some attribute.
        Parameters:
        tag - The attribute tag.
        value - The attribute value.
        Returns:
      • checkValidity

        protected void checkValidity​(Pnml pnml)
        Default check for validity: No action. If some subclass needs to check validity, this method needs to be overruled by it.
        Parameters:
        pnml -