From e7a9b6485e1a6cff45f92bbea59b0307448e51dd Mon Sep 17 00:00:00 2001 From: prakanth <50439067+prakanth97@users.noreply.github.com> Date: Thu, 21 Dec 2023 18:20:52 +0530 Subject: [PATCH] Fix native code path structure --- ballerina/init.bal | 2 +- ballerina/xml_api.bal | 6 +++--- .../stdlib/data/{ => xmldata}/FromString.java | 6 +++--- .../stdlib/data/{ => xmldata}/utils/Constants.java | 4 ++-- .../stdlib/data/{ => xmldata}/utils/DataUtils.java | 6 +++--- .../{ => xmldata}/utils/DiagnosticErrorCode.java | 2 +- .../data/{ => xmldata}/utils/DiagnosticLog.java | 2 +- .../stdlib/data/{ => xmldata}/utils/ModuleUtils.java | 2 +- .../xml/BallerinaByteBlockInputStream.java | 6 +++--- .../stdlib/data/{ => xmldata}/xml/Native.java | 6 +++--- .../stdlib/data/{ => xmldata}/xml/QualifiedName.java | 2 +- .../stdlib/data/{ => xmldata}/xml/XmlParser.java | 12 ++++++------ .../stdlib/data/{ => xmldata}/xml/XmlTraversal.java | 12 ++++++------ native/src/main/java/module-info.java | 2 +- .../xmldata-native}/resource-config.json | 0 15 files changed, 35 insertions(+), 35 deletions(-) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/FromString.java (97%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/Constants.java (95%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/DataUtils.java (99%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/DiagnosticErrorCode.java (97%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/DiagnosticLog.java (97%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/utils/ModuleUtils.java (96%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/BallerinaByteBlockInputStream.java (97%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/Native.java (96%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/QualifiedName.java (98%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/XmlParser.java (99%) rename native/src/main/java/io/ballerina/stdlib/data/{ => xmldata}/xml/XmlTraversal.java (98%) rename native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/{data-native => data/xmldata-native}/resource-config.json (100%) diff --git a/ballerina/init.bal b/ballerina/init.bal index e9c4322..de1aead 100644 --- a/ballerina/init.bal +++ b/ballerina/init.bal @@ -21,5 +21,5 @@ isolated function init() { } isolated function setModule() = @java:Method { - 'class: "io.ballerina.stdlib.data.utils.ModuleUtils" + 'class: "io.ballerina.stdlib.data.xmldata.utils.ModuleUtils" } external; diff --git a/ballerina/xml_api.bal b/ballerina/xml_api.bal index 1ff3f2d..f1c41c0 100644 --- a/ballerina/xml_api.bal +++ b/ballerina/xml_api.bal @@ -72,7 +72,7 @@ public type Error distinct error; # + t - Target type to be used for filtering in the projection # + return - On success, returns the given target type value, else returns an `xmldata:Error` public isolated function fromXmlWithType(xml v, Options options = {}, typedesc t = <>) - returns t|Error = @java:Method {'class: "io.ballerina.stdlib.data.xml.Native"} external; + returns t|Error = @java:Method {'class: "io.ballerina.stdlib.data.xmldata.xml.Native"} external; # Converts XML string, byte[] or byte-stream to record type with projection # @@ -81,7 +81,7 @@ public isolated function fromXmlWithType(xml v, Options options = {}, typedesc s, Options options = {}, typedesc t = <>) - returns t|Error = @java:Method {'class: "io.ballerina.stdlib.data.xml.Native"} external; + returns t|Error = @java:Method {'class: "io.ballerina.stdlib.data.xmldata.xml.Native"} external; # Converts a `Map` or `Record` representation to its XML representation. @@ -120,7 +120,7 @@ isolated function convertMapXml(map|map mapValue) returns xml { } isolated function getModifiedRecord(map mapValue, typedesc<(map|json)> inputType) - returns json|record{}|Error = @java:Method {'class: "io.ballerina.stdlib.data.utils.DataUtils"} external; + returns json|record{}|Error = @java:Method {'class: "io.ballerina.stdlib.data.xmldata.utils.DataUtils"} external; # Provides configurations for converting JSON to XML. # diff --git a/native/src/main/java/io/ballerina/stdlib/data/FromString.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/FromString.java similarity index 97% rename from native/src/main/java/io/ballerina/stdlib/data/FromString.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/FromString.java index d97bdc9..fbf73a3 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/FromString.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/FromString.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data; +package io.ballerina.stdlib.data.xmldata; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; @@ -28,8 +28,8 @@ import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BTypedesc; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.util.Comparator; import java.util.List; diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/Constants.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/Constants.java similarity index 95% rename from native/src/main/java/io/ballerina/stdlib/data/utils/Constants.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/Constants.java index 34d3d15..e860fae 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/Constants.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/Constants.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; @@ -25,7 +25,7 @@ import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BXmlItem; -import io.ballerina.stdlib.data.xml.QualifiedName; +import io.ballerina.stdlib.data.xmldata.xml.QualifiedName; /** * Constants used in Ballerina XmlData library. diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/DataUtils.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DataUtils.java similarity index 99% rename from native/src/main/java/io/ballerina/stdlib/data/utils/DataUtils.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DataUtils.java index 3ca6ab2..b8946ac 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/DataUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DataUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; @@ -36,8 +36,8 @@ import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BTypedesc; -import io.ballerina.stdlib.data.FromString; -import io.ballerina.stdlib.data.xml.QualifiedName; +import io.ballerina.stdlib.data.xmldata.FromString; +import io.ballerina.stdlib.data.xmldata.xml.QualifiedName; import java.util.ArrayList; import java.util.HashMap; diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticErrorCode.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticErrorCode.java similarity index 97% rename from native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticErrorCode.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticErrorCode.java index 214be3b..ff1ee55 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticErrorCode.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticErrorCode.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; /** * Represents a diagnostic error code. diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticLog.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticLog.java similarity index 97% rename from native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticLog.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticLog.java index 5c35cca..559019e 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/DiagnosticLog.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/DiagnosticLog.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; import io.ballerina.runtime.api.creators.ErrorCreator; import io.ballerina.runtime.api.utils.StringUtils; diff --git a/native/src/main/java/io/ballerina/stdlib/data/utils/ModuleUtils.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/ModuleUtils.java similarity index 96% rename from native/src/main/java/io/ballerina/stdlib/data/utils/ModuleUtils.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/ModuleUtils.java index ac21111..28df455 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/utils/ModuleUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/utils/ModuleUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.utils; +package io.ballerina.stdlib.data.xmldata.utils; import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.Module; diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/BallerinaByteBlockInputStream.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/BallerinaByteBlockInputStream.java similarity index 97% rename from native/src/main/java/io/ballerina/stdlib/data/xml/BallerinaByteBlockInputStream.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/BallerinaByteBlockInputStream.java index 6d55537..638f238 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/BallerinaByteBlockInputStream.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/BallerinaByteBlockInputStream.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.async.Callback; @@ -28,8 +28,8 @@ import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BObject; import io.ballerina.runtime.api.values.BString; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.io.IOException; import java.io.InputStream; diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/Native.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/Native.java similarity index 96% rename from native/src/main/java/io/ballerina/stdlib/data/xml/Native.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/Native.java index a9c716a..2d2b101 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/Native.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/Native.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.Future; @@ -30,8 +30,8 @@ import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.api.values.BTypedesc; import io.ballerina.runtime.api.values.BXml; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/QualifiedName.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/QualifiedName.java similarity index 98% rename from native/src/main/java/io/ballerina/stdlib/data/xml/QualifiedName.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/QualifiedName.java index a193828..c0b26e2 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/QualifiedName.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/QualifiedName.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; /** * Represents a qualified name. diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/XmlParser.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlParser.java similarity index 99% rename from native/src/main/java/io/ballerina/stdlib/data/xml/XmlParser.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlParser.java index 1dc746c..3a29c03 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/XmlParser.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlParser.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; @@ -34,11 +34,11 @@ import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BString; -import io.ballerina.stdlib.data.FromString; -import io.ballerina.stdlib.data.utils.Constants; -import io.ballerina.stdlib.data.utils.DataUtils; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.FromString; +import io.ballerina.stdlib.data.xmldata.utils.Constants; +import io.ballerina.stdlib.data.xmldata.utils.DataUtils; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.io.Reader; import java.util.HashMap; diff --git a/native/src/main/java/io/ballerina/stdlib/data/xml/XmlTraversal.java b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlTraversal.java similarity index 98% rename from native/src/main/java/io/ballerina/stdlib/data/xml/XmlTraversal.java rename to native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlTraversal.java index 236b485..0d6afbd 100644 --- a/native/src/main/java/io/ballerina/stdlib/data/xml/XmlTraversal.java +++ b/native/src/main/java/io/ballerina/stdlib/data/xmldata/xml/XmlTraversal.java @@ -16,7 +16,7 @@ * under the License. */ -package io.ballerina.stdlib.data.xml; +package io.ballerina.stdlib.data.xmldata.xml; import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; @@ -37,11 +37,11 @@ import io.ballerina.runtime.api.values.BXml; import io.ballerina.runtime.api.values.BXmlItem; import io.ballerina.runtime.api.values.BXmlSequence; -import io.ballerina.stdlib.data.utils.Constants; -import io.ballerina.stdlib.data.utils.DataUtils; -import io.ballerina.stdlib.data.utils.DataUtils.XmlAnalyzerData; -import io.ballerina.stdlib.data.utils.DiagnosticErrorCode; -import io.ballerina.stdlib.data.utils.DiagnosticLog; +import io.ballerina.stdlib.data.xmldata.utils.Constants; +import io.ballerina.stdlib.data.xmldata.utils.DataUtils; +import io.ballerina.stdlib.data.xmldata.utils.DataUtils.XmlAnalyzerData; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticErrorCode; +import io.ballerina.stdlib.data.xmldata.utils.DiagnosticLog; import java.util.ArrayList; import java.util.HashMap; diff --git a/native/src/main/java/module-info.java b/native/src/main/java/module-info.java index ce7a862..9477b21 100644 --- a/native/src/main/java/module-info.java +++ b/native/src/main/java/module-info.java @@ -22,5 +22,5 @@ requires java.xml; requires junit; requires org.apache.commons.lang3; - exports io.ballerina.stdlib.data.xml; + exports io.ballerina.stdlib.data.xmldata.xml; } diff --git a/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json b/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data/xmldata-native/resource-config.json similarity index 100% rename from native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json rename to native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data/xmldata-native/resource-config.json