Skip to content

Commit

Permalink
Merge pull request #21 from SasinduDilshara/development-2
Browse files Browse the repository at this point in the history
Add javadoc comments for the public java classes
  • Loading branch information
SasinduDilshara authored Aug 1, 2024
2 parents 1b1023e + 82ab586 commit 146dc01
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 51 deletions.
1 change: 1 addition & 0 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repository = "https://github.com/ballerina-platform/module-ballerina-data.csv"
license = ["Apache-2.0"]
distribution = "2201.9.0"
export = ["data.csv"]
readme = "Package.md"

[platform.java17]
graalvmCompatible = true
Expand Down
50 changes: 0 additions & 50 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# Ballerina CSV Data Library

[![Build](https://github.com/ballerina-platform/module-ballerina-data.csv/actions/workflows/build-timestamped-master.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-data.csv/actions/workflows/build-timestamped-master.yml)
[![codecov](https://codecov.io/gh/ballerina-platform/module-ballerina-data.csv/branch/main/graph/badge.svg)](https://codecov.io/gh/ballerina-platform/module-ballerina-data.csv)
[![Trivy](https://github.com/ballerina-platform/module-ballerina-data.csv/actions/workflows/trivy-scan.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-data.csv/actions/workflows/trivy-scan.yml)
[![GraalVM Check](https://github.com/ballerina-platform/module-ballerina-data.csv/actions/workflows/build-with-bal-test-graalvm.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-data.csv/actions/workflows/build-with-bal-test-graalvm.yml)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/ballerina-platform/module-ballerina-data.csv.svg)](https://github.com/ballerina-platform/module-ballerina-data.csv/commits/master)
[![Github issues](https://img.shields.io/github/issues/ballerina-platform/ballerina-standard-library/module/data.csv.svg?label=Open%20Issues)](https://github.com/ballerina-platform/ballerina-standard-library/labels/module%2Fdata.csv)

The Ballerina CSV Data Library is a comprehensive toolkit designed to facilitate the handling and manipulation of CSV data within Ballerina applications. It streamlines the process of converting CSV data to native Ballerina data types, enabling developers to work with CSV content seamlessly and efficiently.

## Features
Expand Down Expand Up @@ -148,49 +141,6 @@ Issues and Projects tabs are disabled for this repository as this is part of the

This repository only contains the source code for the package.

## Building from the source

### Set up the prerequisites

1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).
* [Oracle](https://www.oracle.com/java/technologies/downloads/)
* [OpenJDK](https://adoptium.net/)

2. Export your GitHub personal access token with the read package permissions as follows.

export packageUser=<Username>
export packagePAT=<Personal access token>

### Building the source

Execute the commands below to build from source.

1. To build the library:

./gradlew clean build

2. Publish ZIP artifact to the local `.m2` repository:

./gradlew clean build publishToMavenLocal

3. Publish the generated artifacts to the local Ballerina central repository:

./gradlew clean build -PpublishToLocalCentral=true

4. Publish the generated artifacts to the Ballerina central repository:

./gradlew clean build -PpublishToCentral=true

## Contributing to Ballerina

As an open source project, Ballerina welcomes contributions from the community.

For more information, go to the [contribution guidelines](https://github.com/ballerina-platform/ballerina-lang/blob/master/CONTRIBUTING.md).

## Code of conduct

All contributors are encouraged to read the [Ballerina code of conduct](https://ballerina.io/code-of-conduct).

## Useful links

* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
Expand Down
1 change: 1 addition & 0 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repository = "https://github.com/ballerina-platform/module-ballerina-data.csv"
license = ["Apache-2.0"]
distribution = "2201.9.0"
export = ["data.csv"]
readme = "Package.md"

[platform.java17]
graalvmCompatible = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
*
* @since 0.1.0
*/
public class Native {
public final class Native {
private Native() {
}

public static Object parseStringToRecord(BString csv, BMap<BString, Object> options, BTypedesc type) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BString;

/*
* Constants used in the CSV data module.
*
* @since 0.1.0
*/
public final class Constants {
public final class ConfigConstants {
public static final BString DELIMITER = StringUtils.fromString("delimiter");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BString;

/*
* Configuration for CSV operations.
*
* @since 0.1.0
*/
public class CsvConfig {
public char delimiter = ',';
public char textEnclosure = '\\';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

import static io.ballerina.lib.data.csvdata.utils.Constants.SKIP_LINE_RANGE_SEP;

/*
* Utility functions used in the CSV data module.
*
* @since 0.1.0
*/
public class CsvUtils {

Check warning on line 31 in native/src/main/java/io/ballerina/lib/data/csvdata/utils/CsvUtils.java

View check run for this annotation

Codecov / codecov/patch

native/src/main/java/io/ballerina/lib/data/csvdata/utils/CsvUtils.java#L31

Added line #L31 was not covered by tests
private static final long[] EMPTY_LONG_ARRAY = new long[]{};
public static boolean isCarriageTokenPresent = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import io.ballerina.runtime.api.values.BTypedesc;
import io.ballerina.stdlib.constraint.Constraints;

/*
* Utility functions used in the CSV data module.
*
* @since 0.1.0
*/
public final class DataUtils {
private DataUtils() {
}
Expand Down

0 comments on commit 146dc01

Please sign in to comment.