public class XmiReader extends Object
Modifier | Constructor and Description |
---|---|
protected |
XmiReader(String path) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAttribute(XmiElement element,
XmiAttribute attribute) |
protected void |
addChild(XmiElement parent,
XmiElement newChild) |
protected void |
addElement(XmiElement newElement) |
protected void |
createAttributes(XMLStreamReader streamReader,
XmiElement element) |
List<XmiElement> |
getElements() |
protected List<XmiElement> |
getElements(String namespaceUri) |
protected Map<String,String> |
getNamespaces()
Map has keys of namespaces prefixes and values of namespace URIs.
|
String |
getPath() |
String |
getResourceName() |
protected int |
getStackSize() |
protected void |
handleCharacters(XMLStreamReader streamReader)
Handles a stream
XMLStreamConstants.CHARACTERS event. |
protected XmiElement |
handleEndElement(XMLStreamReader streamReader)
Handles a stream
XMLStreamConstants.END_ELEMENT event. |
protected void |
handleOtherEvents(XMLStreamReader streamReader)
Handles a stream events not covered by other methods.
|
protected XmiElement |
handleStartElement(XMLStreamReader streamReader)
Handles a stream
XMLStreamConstants.START_ELEMENT event. |
protected XmiElement |
pop(XMLStreamReader streamReader) |
protected void |
push(XmiElement element) |
protected List<XmiElement> |
read(InputStream stream) |
protected void |
stop() |
protected XmiReader(String path)
path
- the path to the XMI file being read (cannot be null
or empty)protected void addAttribute(XmiElement element, XmiAttribute attribute)
element
- the element the attribute is being added to (cannot be null
)attribute
- the attribute being added (cannot be null
)protected void addChild(XmiElement parent, XmiElement newChild)
parent
- the element the child element is being added to (cannot be null
)newChild
- the element being added as a child (cannot be null
)protected void addElement(XmiElement newElement)
newElement
- the root level element being added (cannot be null
)protected void createAttributes(XMLStreamReader streamReader, XmiElement element)
streamReader
- the stream reader (cannot be null
)element
- the element whose attributes are being created from the stream (cannot be null
)public List<XmiElement> getElements()
null
)protected List<XmiElement> getElements(String namespaceUri)
namespaceUri
- the namespace URI of the elements being requested (cannot be null
or empty)null
)protected Map<String,String> getNamespaces()
null
)public String getPath()
null
or empty)public String getResourceName()
null
)protected int getStackSize()
protected void handleCharacters(XMLStreamReader streamReader)
XMLStreamConstants.CHARACTERS
event.streamReader
- the stream reader (cannot be null
)protected XmiElement handleEndElement(XMLStreamReader streamReader)
XMLStreamConstants.END_ELEMENT
event.streamReader
- the stream reader (cannot be null
)null
)protected void handleOtherEvents(XMLStreamReader streamReader)
streamReader
- the stream reader (cannot be null
)protected XmiElement handleStartElement(XMLStreamReader streamReader) throws Exception
XMLStreamConstants.START_ELEMENT
event.streamReader
- the stream reader (cannot be null
)null
)Exception
- if there is a problem reading from the streamprotected XmiElement pop(XMLStreamReader streamReader)
streamReader
- the stream reader (cannot be null
)null
)protected void push(XmiElement element)
element
- the XMI element being pushed onto the stack (cannot be null
)protected final List<XmiElement> read(InputStream stream) throws Exception
stream
- the input stream (cannot be null
)null
)Exception
- if there is a problem reading the streamprotected void stop()
Copyright © 2008-2013 JBoss, a division of Red Hat. All Rights Reserved.