com.prosysopc.ua.typedictionary
Class GeneratedDataTypeDictionary

java.lang.Object
  extended by com.prosysopc.ua.typedictionary.GeneratedDataTypeDictionary
All Implemented Interfaces:
DataTypeDictionary

public class GeneratedDataTypeDictionary
extends Object
implements DataTypeDictionary

Class for containing generated DataTypeDictionary information. Instances of this class should be only instantiated by code created by the codegen.


Constructor Summary
GeneratedDataTypeDictionary(String namespaceURI)
          This should be only called by codegenerated code.
 
Method Summary
 void addTypeInformation(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, String typeName, Class<?> javaClass)
          Add a new type information to the dictionary.
 void addTypeInformation(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, String typeName, Class<?> javaClass, String dictionaryTargetNamespace)
          Add a new type information to the dictionary.
 UaNodeId dataTypeIdForType(String namespace, String typeName)
          Returns UaNodeId pointing to the DataType node of the given parameters.
 String getNamespaceURI()
          Returns the AddressSpace NamespaceURI for all the dictionaries contained in this instance.
 Class<?> javaClassForType(String namespaceURI, String typeName)
          Return java class for given parameters.
 Class<?> javaClassForType(UaNodeId typeId)
          Return java class for given parameters.
 Set<String> knownAddressSpaceNamespaces()
          Return the known AddressSpace NamespaceURIs of this dictionary.
 Set<String> supportedDictionaryTargetNamespaces()
          Returns the supported Dictionarty TargetNamespaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratedDataTypeDictionary

public GeneratedDataTypeDictionary(String namespaceURI)
This should be only called by codegenerated code.

Parameters:
namespaceURI - The NamespaceUri for the dictionary address space node(s). Typically this is the same as the TargetNamespace of the Dictionaries, but if they differ (or this instance handles multiple dictionaries for the same namespace) it should be the NamespaceUri of the dictionary node's NodeId NamespaceIndex converted to NamespaceUri from the NamespaceTable.
Method Detail

addTypeInformation

public void addTypeInformation(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                               String typeName,
                               Class<?> javaClass)
Add a new type information to the dictionary. Convinience method for addTypeInformation(ExpandedNodeId, String, Class, String) for cases where the TargetNamespace of the dictionary matches the NamespaceUri of the dictionary nodes.


addTypeInformation

public void addTypeInformation(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                               String typeName,
                               Class<?> javaClass,
                               String dictionaryTargetNamespace)
Add a new type information to the dictionary.

Parameters:
nodeId - The ExpandedNodeId of the type, shall contain the same uri as given in the constructor
typeName - The name of the type (as in a DataTypeDictionary)
javaClass - The java class used for the type in generated Structures
dictionaryTargetNamespace - The TargetNamespace XML Attribute value for the dictionary. If this would be the same as the UA AddressSpace NamespaceURI, addTypeInformation(ExpandedNodeId, String, Class) should be used instead.

dataTypeIdForType

public UaNodeId dataTypeIdForType(String namespace,
                                  String typeName)
Description copied from interface: DataTypeDictionary
Returns UaNodeId pointing to the DataType node of the given parameters. NOTE! this method returns only exact maches, i.e. possible UA super types are not searched.

Specified by:
dataTypeIdForType in interface DataTypeDictionary
Parameters:
namespace - TargetNamespace of a typedictionary
typeName - TypeName of a type within the given namespace
Returns:
UaNodeId pointing to the DataType node for the given type, or null if not found.

getNamespaceURI

public String getNamespaceURI()
Returns the AddressSpace NamespaceURI for all the dictionaries contained in this instance.


javaClassForType

public Class<?> javaClassForType(String namespaceURI,
                                 String typeName)
Description copied from interface: DataTypeDictionary
Return java class for given parameters. NOTE! this method returns only exact maches, i.e. possible UA super types are not searched.

Specified by:
javaClassForType in interface DataTypeDictionary
Parameters:
namespaceURI - URI of the type
typeName - Name of the type
Returns:
java class, or null if not found

javaClassForType

public Class<?> javaClassForType(UaNodeId typeId)
Description copied from interface: DataTypeDictionary
Return java class for given parameters. NOTE! this method returns only exact matches (i.e. super types of the given id are not searched).

Specified by:
javaClassForType in interface DataTypeDictionary
Parameters:
typeId - NodeId of the type
Returns:
java class, or null if not found

knownAddressSpaceNamespaces

public Set<String> knownAddressSpaceNamespaces()
Description copied from interface: DataTypeDictionary
Return the known AddressSpace NamespaceURIs of this dictionary. In practice this means that this dictionary contains the information of all the dictionaries defined in all the namespaces this method returns. The returned list shall be read-only.

Specified by:
knownAddressSpaceNamespaces in interface DataTypeDictionary

supportedDictionaryTargetNamespaces

public Set<String> supportedDictionaryTargetNamespaces()
Description copied from interface: DataTypeDictionary
Returns the supported Dictionarty TargetNamespaces. This should contain all valid values for the namespace part for DataTypeDictionary.javaClassForType(String, String) call. The returned list shall be read-only.

Specified by:
supportedDictionaryTargetNamespaces in interface DataTypeDictionary


Copyright © 2018. All rights reserved.