Class PnmlElement
- java.lang.Object
-
- org.processmining.plugins.pnml.base.PnmlElement
-
- Direct Known Subclasses:
Pnml,PnmlAnnotation,PnmlAnnotationGraphics,PnmlArcGraphics,PnmlBasicObject,PnmlConfiguration,PnmlDimension,PnmlFill,PnmlFinalMarking,PnmlFinalMarkings,PnmlFont,PnmlGroup,PnmlLabelConnection,PnmlLine,PnmlMarkedPlace,PnmlModule,PnmlNodeGraphics,PnmlOffset,PnmlParameter,PnmlPorts,PnmlPosition,PnmlText,PnmlToolSpecific
public abstract class PnmlElement extends java.lang.ObjectBasic PNML element. All PNML objects extend this class (either directly or indirectly).- Author:
- hverbeek
-
-
Field Summary
Fields Modifier and Type Field Description protected static PnmlElementFactoryfactoryintlineNumberjava.lang.StringtagThe PNML tag for this element.
-
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 voidcheckValidity(Pnml pnml)Default check for validity: No action.protected java.lang.StringexportAttribute(java.lang.String tag, java.lang.String value, Pnml pnml)Default way to export some attribute.protected java.lang.StringexportAttributes(Pnml pnml)Exports all standard attributes: None.java.lang.StringexportElement(Pnml pnml)Exports the element.protected java.lang.StringexportElements(Pnml pnml)Exports all standard elements: None.protected voidimportAttributes(org.xmlpull.v1.XmlPullParser xpp, Pnml pnml)Imports all standard attributes: None.voidimportElement(org.xmlpull.v1.XmlPullParser xpp, Pnml pnml)Imports the given element.protected booleanimportElements(org.xmlpull.v1.XmlPullParser xpp, Pnml pnml)Imports all standard child elements: None.protected voidimportText(java.lang.String text, Pnml pnml)Imports standard text: No action.static voidsetFactory(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.
-
-
-
Field Detail
-
factory
protected static PnmlElementFactory factory
-
tag
public java.lang.String tag
The PNML tag for this element.
-
lineNumber
public int lineNumber
-
-
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-
-
-