|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.ModelParserBase
public abstract class ModelParserBase
An XML parser for UA Information Model files defined according to the respective schema, http://opcfoundation.org/UA/2011/03/UANodeSet.xsd.
| Field Summary | |
|---|---|
static String |
UTF8_BOM
|
| Constructor Summary | |
|---|---|
ModelParserBase(UaApplication application)
Creates a new ModelParser. |
|
| Method Summary | |
|---|---|
protected void |
addNamespaceUri(String uri)
|
protected void |
addNodes(List<org.opcfoundation.ua.core.AddNodesItem> nodes,
String type)
|
protected void |
addReferences(List<org.opcfoundation.ua.core.AddReferencesItem> references)
|
protected void |
afterCreate(org.opcfoundation.ua.core.AddNodesItem item)
This method is called once for each Variable and Object node created. |
protected void |
characters(char[] ch,
int start,
int length)
|
void |
createModel(boolean failOnFirstError)
Creates the previously parsed model into the AddressSpaceHandler specified at initialization |
protected org.opcfoundation.ua.builtintypes.NodeId |
doAddNode(org.opcfoundation.ua.core.AddNodesItem item)
Add a new node to the address space |
protected void |
doAddReference(org.opcfoundation.ua.core.AddReferencesItem item)
Add a new reference to the address space |
protected void |
endElement(String uri,
String localName,
String name)
|
org.opcfoundation.ua.encoding.EncoderContext |
getEncoderContext()
|
List<String> |
getErrorList()
|
Collection<org.opcfoundation.ua.builtintypes.ExpandedNodeId> |
getIgnoredNodes()
|
protected abstract org.opcfoundation.ua.common.NamespaceTable |
getNamespaceTable()
|
protected abstract UaNode |
getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Get an existing node in the address space. |
List<org.opcfoundation.ua.core.AddNodesItem> |
getNodes()
|
List<org.opcfoundation.ua.core.AddReferencesItem> |
getReferences()
|
protected abstract org.opcfoundation.ua.common.ServerTable |
getServerTable()
|
boolean |
isFailOnFirstError()
|
protected boolean |
isIgnoredReference(org.opcfoundation.ua.core.AddReferencesItem item)
|
boolean |
isReadingExtensions()
|
protected boolean |
isReadingNamespaces()
|
static boolean |
isSkipValuesOnAndroid()
|
void |
parseFile(InputStream inputStream)
Reads a XML NodeSet file and loads its information into an internal buffer. |
void |
parseFile(InputStream inputStream,
Charset charset)
Reads a XML NodeSet file and loads its information into an internal buffer. |
void |
parseFile(URI uri)
Reads a XML NodeSet file and loads its information into an internal buffer. |
void |
setFailOnFirstError(boolean failOnFirstError)
Define whether #createModel() should fail on the first error found in the model. |
void |
setIgnoredNodes(Collection<org.opcfoundation.ua.builtintypes.ExpandedNodeId> ignoredNodes)
|
static void |
setSkipValuesOnAndroid(boolean skipValuesOnAndroid)
If set to true, skip finalizing value tags from the NodeSet2 xml. |
protected void |
startElement(String uri,
String localName,
String name,
Attributes attributes)
|
protected org.opcfoundation.ua.builtintypes.ExpandedNodeId |
toGlobalExpandedNodeId(org.opcfoundation.ua.builtintypes.NodeId nodeId)
|
protected org.opcfoundation.ua.builtintypes.NodeId |
toGlobalNodeId(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
|
protected org.opcfoundation.ua.builtintypes.NodeId |
toGlobalNodeId(org.opcfoundation.ua.builtintypes.NodeId nodeId)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String UTF8_BOM
| Constructor Detail |
|---|
public ModelParserBase(UaApplication application)
nodeManagerTable - the NodeManagerTable in which the nodes should be created.| Method Detail |
|---|
public static boolean isSkipValuesOnAndroid()
setSkipValuesOnAndroid(boolean)public static void setSkipValuesOnAndroid(boolean skipValuesOnAndroid)
skipValuesOnAndroid -
public void createModel(boolean failOnFirstError)
throws ModelException,
ServiceException
failOnFirstError - make the model creation fail for the first error encountered. If false,
the model is parsed fully and possible errors are raised only at the end.
ModelException - if there is a problem with the model and it cannot be fully created. The
exception is thrown for individual nodes only if isFailOnFirstError() is true.
Otherwise, it will be filled with and errorList.
ServiceException - if the nodes cannot be added to the server due to a service exception
(most likely when done from the client side)public org.opcfoundation.ua.encoding.EncoderContext getEncoderContext()
public List<String> getErrorList()
public Collection<org.opcfoundation.ua.builtintypes.ExpandedNodeId> getIgnoredNodes()
public List<org.opcfoundation.ua.core.AddNodesItem> getNodes()
public List<org.opcfoundation.ua.core.AddReferencesItem> getReferences()
public boolean isFailOnFirstError()
public boolean isReadingExtensions()
public void parseFile(InputStream inputStream)
throws IOException,
SAXException,
ModelException
#createModel() to create the nodes from the buffer.
inputStream - the model file to parse (from stream)
SAXException - if the required XMLReaded cannot be created.
IOException - if the model file cannot be read.
ModelException - if the file contains model errors
public void parseFile(InputStream inputStream,
Charset charset)
throws IOException,
SAXException,
ModelException
#createModel() to create the nodes from the buffer.
inputStream - the model file to parse (from stream)charset - the character set of the model file (stream) default is UTF-8
SAXException - if the required XMLReaded cannot be created.
IOException - if the model file cannot be read.
ModelException - if the file contains model errors
public void parseFile(URI uri)
throws SAXException,
IOException,
ModelException
#createModel() to create the nodes from the buffer.
uri - the model file to parse
SAXException - if the required XMLReaded cannot be created.
IOException - if the model file cannot be read.
ModelException - if the file contains model errorspublic void setFailOnFirstError(boolean failOnFirstError)
#createModel() should fail on the first error found in the model.
failOnFirstError - the failOnFirstError to setpublic void setIgnoredNodes(Collection<org.opcfoundation.ua.builtintypes.ExpandedNodeId> ignoredNodes)
ignoredNodes - protected void addNamespaceUri(String uri)
uri -
protected void addNodes(List<org.opcfoundation.ua.core.AddNodesItem> nodes,
String type)
throws ModelException,
ServiceException
nodes - type -
ModelException
ServiceException
protected void addReferences(List<org.opcfoundation.ua.core.AddReferencesItem> references)
throws ModelException
ModelExceptionprotected void afterCreate(org.opcfoundation.ua.core.AddNodesItem item)
protected void characters(char[] ch,
int start,
int length)
ch - start - length -
protected org.opcfoundation.ua.builtintypes.NodeId doAddNode(org.opcfoundation.ua.core.AddNodesItem item)
throws StatusException,
ServiceException
item -
StatusException
ServiceException
protected void doAddReference(org.opcfoundation.ua.core.AddReferencesItem item)
throws StatusException,
ServiceException
item -
StatusException
ServiceException
protected void endElement(String uri,
String localName,
String name)
throws SAXException
SAXExceptionprotected abstract org.opcfoundation.ua.common.NamespaceTable getNamespaceTable()
protected abstract UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
throws StatusException
nodeId -
StatusExceptionprotected abstract org.opcfoundation.ua.common.ServerTable getServerTable()
protected boolean isIgnoredReference(org.opcfoundation.ua.core.AddReferencesItem item)
item -
protected boolean isReadingNamespaces()
protected void startElement(String uri,
String localName,
String name,
Attributes attributes)
throws SAXException
SAXExceptionprotected org.opcfoundation.ua.builtintypes.ExpandedNodeId toGlobalExpandedNodeId(org.opcfoundation.ua.builtintypes.NodeId nodeId)
nodeId -
protected org.opcfoundation.ua.builtintypes.NodeId toGlobalNodeId(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
nodeId -
protected org.opcfoundation.ua.builtintypes.NodeId toGlobalNodeId(org.opcfoundation.ua.builtintypes.NodeId nodeId)
nodeId -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||