public class PNMLSerializer extends org.xml.sax.helpers.DefaultHandler
parse(String filename)| Constructor and Description |
|---|
PNMLSerializer() |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
clear()
Clear the internal data structures of the parser
|
void |
endElement(String uri,
String localName,
String qName) |
void |
error(SAXParseException e)
Called, if an error occurs while XML-Doc is parsed.
|
NetSystem |
parse(byte[] pnmlContent)
Parses a NetSystem out of the given PNML XML-File.
|
NetSystem |
parse(String file)
Parses a NetSystem out of a predefined PNML-file
|
static Document |
serialize(NetSystem net)
Serializes the given PetriNet to PNML and returns the according Document object.
|
static Document |
serialize(NetSystem net,
int tool)
Serializes the given PetriNet to PNML and returns the according Document object.
|
static String |
serializePetriNet(NetSystem net)
Creates a PNML XML string from the given
PetriNet. |
static String |
serializePetriNet(NetSystem net,
int tool)
Creates a PNML XML string from the given
PetriNet. |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes) |
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningpublic void clear()
public NetSystem parse(byte[] pnmlContent)
pnmlContent - A process description based on the PNML-Standard as byte array.NetSystem parsed from the given PNML-content.public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement in interface ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void error(SAXParseException e) throws SAXException
error in interface ErrorHandlererror in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic static String serializePetriNet(NetSystem net) throws SerializationException
PetriNet.net - PetriNet to transform into PNML-StringSerializationExceptionpublic static String serializePetriNet(NetSystem net, int tool) throws SerializationException
PetriNet.net - PetriNet to transform into PNML-Stringtool - integer indicating the toolSerializationExceptionpublic static Document serialize(NetSystem net) throws SerializationException
net - PetriNet to serializeSerializationExceptionpublic static Document serialize(NetSystem net, int tool) throws SerializationException
the - PetriNettool - integer indicating the toolSerializationExceptionCopyright © 2017. All rights reserved.