You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/08/08 11:55:51 UTC

[plc4x-build-tools] branch develop updated: - Added some additional field types

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x-build-tools.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9f736ab  - Added some additional field types
9f736ab is described below

commit 9f736ab53e344f967ec6b754aff383bcfc817633
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 8 13:55:44 2019 +0200

    - Added some additional field types
---
 .../codegenerator/types/fields/ChecksumField.java  | 32 +++++++++++++++
 .../types/fields/ManualArrayField.java             | 45 ++++++++++++++++++++++
 .../codegenerator/types/fields/ManualField.java    | 34 ++++++++++++++++
 .../codegenerator/types/fields/PaddingField.java   | 35 +++++++++++++++++
 4 files changed, 146 insertions(+)

diff --git a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ChecksumField.java b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ChecksumField.java
new file mode 100644
index 0000000..af8fcdd
--- /dev/null
+++ b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ChecksumField.java
@@ -0,0 +1,32 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+package org.apache.plc4x.plugins.codegenerator.types.fields;
+
+import org.apache.plc4x.plugins.codegenerator.types.terms.Term;
+
+public interface ChecksumField extends TypedField {
+
+    default String getTypeName() {
+        return "checksum";
+    }
+
+    Term getChecksumExpression();
+
+}
diff --git a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ManualArrayField.java b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ManualArrayField.java
new file mode 100644
index 0000000..2caf15e
--- /dev/null
+++ b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ManualArrayField.java
@@ -0,0 +1,45 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+package org.apache.plc4x.plugins.codegenerator.types.fields;
+
+
+import org.apache.plc4x.plugins.codegenerator.types.terms.Term;
+
+public interface ManualArrayField extends PropertyField {
+
+    default String getTypeName() {
+        return "manualArray";
+    }
+
+    LengthType getLengthType();
+
+    Term getLengthExpression();
+
+    Term getSerializationExpression();
+
+    Term getDeserializationExpression();
+
+    enum LengthType {
+        COUNT,
+        LENGTH,
+        TERMINATED
+    }
+
+}
diff --git a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ManualField.java b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ManualField.java
new file mode 100644
index 0000000..07cfb62
--- /dev/null
+++ b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/ManualField.java
@@ -0,0 +1,34 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+package org.apache.plc4x.plugins.codegenerator.types.fields;
+
+import org.apache.plc4x.plugins.codegenerator.types.terms.Term;
+
+public interface ManualField extends PropertyField {
+
+    default String getTypeName() {
+        return "manual";
+    }
+
+    Term getSerializationExpression();
+
+    Term getDeserializationExpression();
+
+}
diff --git a/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/PaddingField.java b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/PaddingField.java
new file mode 100644
index 0000000..5d2e655
--- /dev/null
+++ b/code-generation/types-base/src/main/java/org/apache/plc4x/plugins/codegenerator/types/fields/PaddingField.java
@@ -0,0 +1,35 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+package org.apache.plc4x.plugins.codegenerator.types.fields;
+
+
+import org.apache.plc4x.plugins.codegenerator.types.terms.Term;
+
+public interface PaddingField extends TypedField {
+
+    default String getTypeName() {
+        return "padding";
+    }
+
+    Term getPaddingValue();
+
+    Term getPaddingCondition();
+
+}