hutcheb commented on a change in pull request #210:
URL: https://github.com/apache/plc4x/pull/210#discussion_r542054349
##########
File path:
plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaField.java
##########
@@ -30,30 +30,34 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public class OpcuaField implements PlcField {
- public static final Pattern ADDRESS_PATTERN =
Pattern.compile("^ns=(?<namespace>\\d+);(?<identifierType>[isgb])=((?<identifier>.+))?");
+ public static final Pattern ADDRESS_PATTERN =
Pattern.compile("^ns=(?<namespace>\\d+);(?<identifierType>[isgb])=((?<identifier>[^:]+))?(:(?<datatype>[a-zA-Z_]+))?");
private final OpcuaIdentifierType identifierType;
private final int namespace;
private final String identifier;
- protected OpcuaField(int namespace, OpcuaIdentifierType identifierType,
String identifier) {
+ private final String dataType;
+
+ protected OpcuaField(int namespace, OpcuaIdentifierType identifierType,
String identifier, String dataType) {
this.namespace = namespace;
this.identifier = identifier;
this.identifierType = identifierType;
if (this.identifier == null || this.namespace < 0) {
throw new IllegalArgumentException("Identifier can not be null or
Namespace can not be lower then 0.");
}
+ this.dataType = dataType != null ? dataType.toUpperCase() : null;
}
Review comment:
I don't see any reason why we can't change this to an enum. To keep it
the same as the others I'll add an mspec for opc ua for the datatype enum.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]