com.prosysopc.ua.client.nodes
Class UaTypeImpl

java.lang.Object
  extended by com.prosysopc.ua.nodes.AbstractUaNode
      extended by com.prosysopc.ua.client.nodes.UaNodeImpl
          extended by com.prosysopc.ua.client.nodes.UaTypeImpl
All Implemented Interfaces:
UaNode, UaType
Direct Known Subclasses:
UaDataTypeImpl, UaObjectTypeImpl, UaReferenceTypeImpl, UaVariableTypeImpl

public abstract class UaTypeImpl
extends UaNodeImpl
implements UaType

Generic type node. This is a base node type for all type nodes.

Note that the OPC UA Specification does not define or represent such a common "base class" for all type nodes. However, all type nodes support IsAbstract attribute, and the nodes exist in the Types section of the address space only.


Field Summary
protected  Class<?> javaClass
           
 
Fields inherited from class com.prosysopc.ua.client.nodes.UaNodeImpl
addressSpace, logger, references, supportedAttributesMap
 
Constructor Summary
protected UaTypeImpl(AddressSpace addressSpace, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
           
protected UaTypeImpl(AddressSpace addressSpace, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName, org.opcfoundation.ua.builtintypes.LocalizedText description, EnumSet<WriteAccess> writeMask, EnumSet<WriteAccess> userWriteMask, UaClientReference[] references, UaProperty[] properties, Boolean isAbstract)
           
  UaTypeImpl(AddressSpace addressSpace, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
          Create a new node with name to be used for browseName and displayName.
 
Method Summary
 void addSubType(UaType node)
          Add a new sub type for the type.
 Boolean getIsAbstract()
          A boolean Attribute with the following values: true it is an abstract Type, i.e. no instances of this type shall exist, only of its subtypes.
 Class<?> getJavaClass()
          Defines a Java class which is used to keep data of the specified UA type.
 UaType getSuperType()
           
 boolean hasSuperType()
           
 boolean inheritsFrom(org.opcfoundation.ua.builtintypes.NodeId typeId)
          Check if the type inherits from the specified type.
 boolean inheritsFrom(UaType type)
          Check if the type inherits from the specified type.
protected  void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
           
protected  void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Read the value of an attribute.
 void setIsAbstract(Boolean isAbstract)
           
 void setJavaClass(Class<?> javaClass)
           
 void setSuperType(UaType parent)
          Set the ModelParent reference.
 String toString()
           
protected  void writeAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, Object value, org.opcfoundation.ua.builtintypes.StatusCode statusCode, org.opcfoundation.ua.builtintypes.DateTime sourceTime, org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
           
 
Methods inherited from class com.prosysopc.ua.client.nodes.UaNodeImpl
addComponent, addProperties, addProperty, addReference, addReference, addReference, addReference, afterAddReference, afterDeleteReference, assertTypeSupport, assertTypeSupport, beforeAddReference, deleteReference, deleteReference, deleteReference, deleteReference, deleteReferences, doAddProperty, equals, findPlaceholders, getAddressSpace, getAttributes, getBrowseName, getComponent, getComponents, getDescription, getDescription, getDisplayName, getDisplayName, getMethod, getNodeClass, getNodeId, getNodeVersion, getNodeVersionString, getProperties, getProperty, getPropertyValue, getReference, getReferenceList, getReferences, getSupportedAttributes, getUserWriteMask, getWriteMask, hashCode, hasProperty, hasTypeDefinition, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, referenceTypeInherits, removeComponent, removeProperty, setAttribute, setAttributes, setBrowseName, setDescription, setDisplayName, setNodeVersion, setPropertyValue, setReferences, setUserWriteMask, setWriteMask, supportsAttribute, writeAttribute
 
Methods inherited from class com.prosysopc.ua.nodes.AbstractUaNode
getForwardReferences, getInverseReferences, getReferences, getReferences, getReferencesAsList, referenceTypeInherits
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.prosysopc.ua.nodes.UaNode
addComponent, addProperty, addReference, addReference, addReference, deleteReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getAttributes, getBrowseName, getComponent, getComponents, getDescription, getDisplayName, getForwardReferences, getInverseReferences, getMethod, getNodeClass, getNodeId, getNodeVersion, getProperties, getProperty, getReference, getReferences, getReferences, getSupportedAttributes, getUserWriteMask, getWriteMask, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, removeComponent, removeProperty, setAttribute, setAttributes, setBrowseName, setDescription, setDisplayName, setReferences, setUserWriteMask, setWriteMask, supportsAttribute, writeAttribute
 

Field Detail

javaClass

protected Class<?> javaClass
Constructor Detail

UaTypeImpl

public UaTypeImpl(AddressSpace addressSpace,
                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                  String name,
                  Locale locale)
Create a new node with name to be used for browseName and displayName.

Parameters:
nodeId -
name -
locale -

UaTypeImpl

protected UaTypeImpl(AddressSpace addressSpace,
                     org.opcfoundation.ua.builtintypes.NodeId nodeId,
                     org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                     org.opcfoundation.ua.builtintypes.LocalizedText displayName)

UaTypeImpl

protected UaTypeImpl(AddressSpace addressSpace,
                     org.opcfoundation.ua.builtintypes.NodeId nodeId,
                     org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                     org.opcfoundation.ua.builtintypes.LocalizedText displayName,
                     org.opcfoundation.ua.builtintypes.LocalizedText description,
                     EnumSet<WriteAccess> writeMask,
                     EnumSet<WriteAccess> userWriteMask,
                     UaClientReference[] references,
                     UaProperty[] properties,
                     Boolean isAbstract)
Method Detail

addSubType

public void addSubType(UaType node)
Description copied from interface: UaType
Add a new sub type for the type.

Adds a new reference of type HasSubType to the node with target set to type.

Specified by:
addSubType in interface UaType
Parameters:
node - the node to add.

getIsAbstract

public Boolean getIsAbstract()
Description copied from interface: UaType
A boolean Attribute with the following values:
true it is an abstract Type, i.e. no instances of this type shall exist, only of its subtypes.
false it is not an abstract Type, i.e. instances of this type can exist.

Specified by:
getIsAbstract in interface UaType
Returns:
the current value of IsAbstract

getJavaClass

public Class<?> getJavaClass()
Description copied from interface: UaType
Defines a Java class which is used to keep data of the specified UA type. Mostly used for UA DataTypes, but can also define classes for specific object and variable types.

For example, the node for UA DataType Int32 typically defines java.lang.Integer as the Java class.

Specified by:
getJavaClass in interface UaType
Returns:
the Java class used for the type

getSuperType

public UaType getSuperType()
Specified by:
getSuperType in interface UaType
Returns:
the UA type that is defined as the ancestor of the type in the UA AddressSpace. Or null, if the type has no super type (e.g. BaseObjectType has no super type)
See Also:
UaType.hasSuperType()

hasSuperType

public boolean hasSuperType()
Specified by:
hasSuperType in interface UaType
Returns:
whether the type has a super type. If not, UaType.getSuperType() returns null.

inheritsFrom

public boolean inheritsFrom(org.opcfoundation.ua.builtintypes.NodeId typeId)
Description copied from interface: UaType
Check if the type inherits from the specified type.

Specified by:
inheritsFrom in interface UaType
Parameters:
typeId - The NodeId of the type to check
Returns:
true if this type inherits from the specified type, i.e. it is itself or (recursively) has a modelParent that equals to typeId
See Also:
UaType.getSuperType()

inheritsFrom

public boolean inheritsFrom(UaType type)
Description copied from interface: UaType
Check if the type inherits from the specified type.

Specified by:
inheritsFrom in interface UaType
Parameters:
type - The NodeId of the type to check
Returns:
true if this type inherits from the specified type, i.e. it is itself or (recursively) has a modelParent that equals to typeId
See Also:
UaType.getSuperType()

setIsAbstract

public void setIsAbstract(Boolean isAbstract)
Specified by:
setIsAbstract in interface UaType
Parameters:
isAbstract - the value to set for IsAbstract
See Also:
UaType.getIsAbstract()

setJavaClass

public void setJavaClass(Class<?> javaClass)
Specified by:
setJavaClass in interface UaType
Parameters:
javaClass - the Java class to use for the type.
See Also:
UaType.getJavaClass()

setSuperType

public void setSuperType(UaType parent)
Description copied from interface: UaType
Set the ModelParent reference.

Specified by:
setSuperType in interface UaType
Parameters:
parent - the super type to set.

toString

public String toString()
Overrides:
toString in class UaNodeImpl

initSupportedAttributes

protected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
Overrides:
initSupportedAttributes in class UaNodeImpl

readAttributeValue

protected void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                  org.opcfoundation.ua.builtintypes.DataValue dataValue)
                           throws StatusException
Description copied from class: UaNodeImpl
Read the value of an attribute.

Overrides:
readAttributeValue in class UaNodeImpl
Parameters:
attributeId - the ID of the attribute to read.
dataValue - the DataValue structure in which the value is set.
Throws:
StatusException

writeAttributeValue

protected void writeAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                   Object value,
                                   org.opcfoundation.ua.builtintypes.StatusCode statusCode,
                                   org.opcfoundation.ua.builtintypes.DateTime sourceTime,
                                   org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
                            throws StatusException
Overrides:
writeAttributeValue in class UaNodeImpl
Throws:
StatusException


Copyright © 2018. All rights reserved.