Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API doc website #69

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
37 changes: 37 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2025 SPDX contributors
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: Apache-2.0

name: Generate and publish API JavaDocs
on:
push:
branches:
- master
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

- name: Generate docs
run: mvn javadoc:javadoc

- name: Deploy docs
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/reports/apidocs
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@ SPDX store that supports serializing and deserializing SPDX tag/value files.

This library utilizes the [SPDX Java Library Storage Interface](https://github.com/spdx/Spdx-Java-Library#storage-interface) extending the `ExtendedSpdxStore` which allows for utilizing any underlying store which implements the [SPDX Java Library Storage Interface](https://github.com/spdx/Spdx-Java-Library#storage-interface).

# Code quality badges
The API documentation is available at:
<https://spdx.github.io/spdx-java-tagvalue-store/>

| [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=spdx-tagvalue-store&metric=bugs)](https://sonarcloud.io/dashboard?id=spdx-tagvalue-store) | [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=spdx-tagvalue-store&metric=security_rating)](https://sonarcloud.io/dashboard?id=spdx-tagvalue-store) | [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=spdx-tagvalue-store&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=spdx-tagvalue-store) | [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=spdx-tagvalue-store&metric=sqale_index)](https://sonarcloud.io/dashboard?id=spdx-tagvalue-store) |
## Code quality badges

# Using the Library
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=spdx-tagvalue-store&metric=bugs)](https://sonarcloud.io/dashboard?id=spdx-tagvalue-store)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=spdx-tagvalue-store&metric=security_rating)](https://sonarcloud.io/dashboard?id=spdx-tagvalue-store)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=spdx-tagvalue-store&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=spdx-tagvalue-store)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=spdx-tagvalue-store&metric=sqale_index)](https://sonarcloud.io/dashboard?id=spdx-tagvalue-store)

## Using the Library

This library is intended to be used in conjunction with the [SPDX Java Library](https://github.com/spdx/Spdx-Java-Library).

Create an instance of a store which implements the [SPDX Java Library Storage Interface](https://github.com/spdx/Spdx-Java-Library#storage-interface). For example, the [InMemSpdxStore](https://github.com/spdx/Spdx-Java-Library/blob/master/src/main/java/org/spdx/storage/simple/InMemSpdxStore.java) is a simple in-memory storage suitable for simple file serializations and deserializations.

Create an instance of `TagValueStore(IModelStore baseStore)` passing in the instance of a store created above along with the format.

# Serializing and Deserializing
## Serializing and Deserializing

This library supports the `ISerializableModelStore` interface for serializing and deserializing files based on the format specified.

# Development Status
## Development Status

Mostly stable - although it has not been widely used.
13 changes: 9 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<version>3.5.0</version>
<configuration>
<quiet>true</quiet>
<source>8</source>
<javadocExecutable>${env.JAVA_HOME}/bin/javadoc</javadocExecutable>
<additionalparam>-Xdoclint:none</additionalparam>
<doclint>all,-missing</doclint>
<links>
<link>https://spdx.github.io/spdx-java-core/</link>
<link>https://spdx.github.io/Spdx-Java-Library/</link>
</links>
<detectLinks>true</detectLinks>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -206,8 +211,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>8</source>
<target>8</target>
<encoding>${project.build.sourceEncoding}</encoding>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/org/spdx/tag/BuildDocument.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
/**
* Copyright (c) 2011 Source Auditor Inc.
*
* SPDX-FileContributor: Rana Rahal, Protecode Inc.
* SPDX-FileContributor: Gary O'Neall
* SPDX-FileCopyrightText: Copyright (c) 2011 Source Auditor Inc.
* SPDX-FileType: SOURCE
* SPDX-License-Identifier: Apache-2.0
* <p>
* Licensed 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
*
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.spdx.tag;

Expand Down
30 changes: 9 additions & 21 deletions src/main/java/org/spdx/tag/CommonCode.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
/**

* Copyright (c) 2010 Source Auditor Inc.

*

* SPDX-FileContributor: Rana Rahal, Protecode Inc.
* SPDX-FileContributor: Gary O'Neall
* SPDX-FileCopyrightText: Copyright (c) 2015 Source Auditor Inc.
* SPDX-FileType: SOURCE
* SPDX-License-Identifier: Apache-2.0
* <p>
* Licensed 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

*

* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.spdx.tag;

Expand Down
22 changes: 12 additions & 10 deletions src/main/java/org/spdx/tag/HandBuiltParser.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/**
* Copyright (c) 2013 Source Auditor Inc.
*
* SPDX-FileContributor: Gary O'Neall
* SPDX-FileCopyrightText: Copyright (c) 2013 Source Auditor Inc.
* SPDX-FileType: SOURCE
* SPDX-License-Identifier: Apache-2.0
* <p>
* Licensed 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
*
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.spdx.tag;

import java.util.regex.Matcher;
Expand All @@ -23,11 +25,11 @@
* I'm hoping this is a temporary solution. This is a hand built parser to parse
* SPDX tag files. It replaces the current ANTL based parser which has a defect
* where any lines starting with a text ending with a : is treated as a tag even
* if it is in <text> </text>
* if it is in <code>&lt;text&gt; &lt;/text&gt;</code>.
*
* The interface is similar to the generated ANTLR code
* @author Gary O'Neall
* The interface is similar to the generated ANTLR code.
*
* @author Gary O'Neall
*/
public class HandBuiltParser {

Expand Down
18 changes: 10 additions & 8 deletions src/main/java/org/spdx/tag/InvalidFileFormatException.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
/**
* Copyright (c) 2017 Source Auditor Inc.
*
* SPDX-FileContributor: Rohit Lodha
* SPDX-FileContributor: Gary O'Neall
* SPDX-FileCopyrightText: Copyright (c) 2017 Source Auditor Inc.
* SPDX-FileType: SOURCE
* SPDX-License-Identifier: Apache-2.0
* <p>
* Licensed 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
*
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.spdx.tag;

import org.spdx.core.InvalidSPDXAnalysisException;
Expand All @@ -22,7 +25,6 @@
* Exceptions for invalid SPDX file format
*
* @author Rohit Lodha
*
*/
public class InvalidFileFormatException extends InvalidSPDXAnalysisException {

Expand Down
17 changes: 9 additions & 8 deletions src/main/java/org/spdx/tag/InvalidSpdxTagFileException.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/**
* Copyright (c) 2012 Source Auditor Inc.
*
* SPDX-FileContributor: Gary O'Neall
* SPDX-FileCopyrightText: Copyright (c) 2012 Source Auditor Inc.
* SPDX-FileType: SOURCE
* SPDX-License-Identifier: Apache-2.0
* <p>
* Licensed 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
*
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.spdx.tag;

import org.spdx.core.InvalidSPDXAnalysisException;
Expand All @@ -22,7 +24,6 @@
* Exceptions for errors in a SPDX tag format file
*
* @author Gary O'Neall
*
*/
public class InvalidSpdxTagFileException extends InvalidSPDXAnalysisException {

Expand Down
21 changes: 11 additions & 10 deletions src/main/java/org/spdx/tag/NoCommentInputStream.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/**
* Copyright (c) 2013 Source Auditor Inc.
*
* SPDX-FileContributor: Gary O'Neall
* SPDX-FileCopyrightText: Copyright (c) 2013 Source Auditor Inc.
* SPDX-FileType: SOURCE
* SPDX-License-Identifier: Apache-2.0
* <p>
* Licensed 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
*
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.spdx.tag;

import java.io.BufferedReader;
Expand All @@ -25,12 +27,11 @@
import org.slf4j.LoggerFactory;

/**
* @author Gary O'Neall
*
* Input stream which filters out any SPDX tag/value comments
* Any new line which begins with a # is skipped until the end of line except
* if it is within a <text> </text> wrapper
* if it is within a <code>&lt;text&gt; &lt;/text&gt;</code> wrapper.
*
* @author Gary O'Neall
*/
public class NoCommentInputStream extends InputStream {

Expand Down
16 changes: 7 additions & 9 deletions src/main/java/org/spdx/tag/RecognitionException.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
/**
* Copyright (c) 2020 Source Auditor Inc.
*
* SPDX-FileContributor: Gary O'Neall
* SPDX-FileCopyrightText: Copyright (c) 2020 Source Auditor Inc.
* SPDX-FileType: SOURCE
* SPDX-License-Identifier: Apache-2.0
*
* <p>
* Licensed 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
*
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.spdx.tag;

Expand All @@ -24,7 +23,6 @@
/**
* Parser/Scanner recognition errors
* @author Gary O'Neall
*
*/
public class RecognitionException extends InvalidSPDXAnalysisException {

Expand Down
Loading
Loading