Skip to content

Commit

Permalink
CADC-13400 javadoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jburke-cadc committed Jul 22, 2024
1 parent 81a9731 commit b829910
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 88 deletions.
3 changes: 2 additions & 1 deletion doi/src/main/java/ca/nrc/cadc/doi/DoiAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ public DoiAction() { }
* and to make the DOI findable.
* For DOI deletion, the service could delete the DOI irrespective of its status.
* However this has not been implemented.
* @return
*
* @return new DoiInlineContentHandler
*/
@Override
protected InlineContentHandler getInlineContentHandler() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public class ResourceType {
/**
* DOIResourceType constructor.
*
* @param resourceTypeGeneral the DataCite resource type
*/
public ResourceType(DataCiteResourceType resourceTypeGeneral) {
if (resourceTypeGeneral == null) {
Expand Down
3 changes: 2 additions & 1 deletion doi/src/main/java/ca/nrc/cadc/doi/io/DoiXmlReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public DoiXmlReader() {
* is likely to fail in horrible ways (e.g. NullPointerException) if it receives
* invalid documents. However, performance may be improved.
*
* @param enableSchemaValidation
* @param enableSchemaValidation enable XML schema validation of the document.
*/
public DoiXmlReader(boolean enableSchemaValidation) {
if (enableSchemaValidation) {
Expand Down Expand Up @@ -176,6 +176,7 @@ public Resource read(InputStream in) throws IOException, DoiParsingException {
* @param reader Reader.
* @return Resource object containing all doi metadata.
* @throws IOException when an I/O error prevents a document from being fully parsed
* @throws DoiParsingException when the document is invalid
*/
public Resource read(Reader reader) throws DoiParsingException, IOException {
if (reader == null) {
Expand Down
25 changes: 9 additions & 16 deletions doi/src/main/java/ca/nrc/cadc/doi/status/DoiStatusJsonWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ public void write(DoiStatus doiStatus, OutputStream out) throws IOException {
/**
* Write a DoiStatus instance to a StringBuilder.
*
* @param doiStatus
* DoiStatus instance to write.
* @param builder
* @throws IOException
* @param doiStatus DoiStatus instance to write.
* @param builder write the DoiStatus to the builder
* @throws IOException is the writer fails to write.
*/
public void write(DoiStatus doiStatus, StringBuilder builder) throws IOException {
write(doiStatus, new StringBuilderWriter(builder));
Expand All @@ -134,12 +133,9 @@ public void write(DoiStatus doiStatus, StringBuilder builder) throws IOException
/**
* Write the DoiStatus instance to a writer.
*
* @param doiStatus
* DoiStatus instance to write.
* @param writer
* Writer to write to.
* @throws IOException
* if the writer fails to write.
* @param doiStatus DoiStatus instance to write.
* @param writer Writer to write to.
* @throws IOException if the writer fails to write.
*/
public void write(DoiStatus doiStatus, Writer writer) throws IOException {
long start = System.currentTimeMillis();
Expand All @@ -152,12 +148,9 @@ public void write(DoiStatus doiStatus, Writer writer) throws IOException {
/**
* Write a Document instance by providing the root element to a writer.
*
* @param root
* Root element to write.
* @param writer
* Writer to write to.
* @throws IOException
* if the writer fails to write.
* @param root Root element to write.
* @param writer Writer to write to.
* @throws IOException if the writer fails to write.
*/
protected void write(Element root, Writer writer) throws IOException {
JsonOutputter outputter = new JsonOutputter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ public void write(List<DoiStatus> doiStatusList, OutputStream out) throws IOExce
/**
* Write a list of DoiStatus instances to a StringBuilder.
*
* @param doiStatusList
* List of DoiStatus instances to write.
* @param builder
* @throws IOException
* @param doiStatusList List of DoiStatus instances to write.
* @param builder the builder to write to.
* @throws IOException if the writer fails to write.
*/
public void write(List<DoiStatus> doiStatusList, StringBuilder builder) throws IOException {
write(doiStatusList, new StringBuilderWriter(builder));
Expand All @@ -135,12 +134,9 @@ public void write(List<DoiStatus> doiStatusList, StringBuilder builder) throws I
/**
* Write the list of DoiStatus instances to a writer.
*
* @param doiStatusList
* List of DoiStatus instances to write.
* @param writer
* Writer to write to.
* @throws IOException
* if the writer fails to write.
* @param doiStatusList List of DoiStatus instances to write.
* @param writer Writer to write to.
* @throws IOException if the writer fails to write.
*/
public void write(List<DoiStatus> doiStatusList, Writer writer) throws IOException {
long start = System.currentTimeMillis();
Expand All @@ -153,12 +149,9 @@ public void write(List<DoiStatus> doiStatusList, Writer writer) throws IOExcepti
/**
* Write a Document instance by providing the root element to a writer.
*
* @param root
* Root element to write.
* @param writer
* Writer to write to.
* @throws IOException
* if the writer fails to write.
* @param root Root element to write.
* @param writer Writer to write to.
* @throws IOException if the writer fails to write.
*/
protected void write(Element root, Writer writer) throws IOException {
JsonOutputter outputter = new JsonOutputter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public List<DoiStatus> read(String xml) throws DoiParsingException {
* Construct a list of DoiStatus from a InputStream.
*
* @param in InputStream.
* @return List of DoiStatus object .
* @return List of DoiStatus objects.
* @throws IOException if error reading InputStream.
* @throws DoiParsingException if there is an error parsing the XML.
*/
public List<DoiStatus> read(InputStream in) throws IOException, DoiParsingException {
Expand All @@ -140,6 +141,7 @@ public List<DoiStatus> read(InputStream in) throws IOException, DoiParsingExcept
*
* @param reader Reader.
* @return List of DoiStatus object containing the status of the specified DOI.
* @throws IOException if error reading InputStream.
* @throws DoiParsingException if there is an error parsing the XML.
*/
public List<DoiStatus> read(Reader reader) throws DoiParsingException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,9 @@ public DoiStatusListXmlWriter() {
/**
* Write a list of DoiStatus instances to an OutputStream using UTF-8 encoding.
*
* @param doiStatusList
* List of DoiStatus instances to write.
* @param out
* OutputStream to write to.
* @throws IOException
* if the writer fails to write.
* @param doiStatusList List of DoiStatus instances to write.
* @param out OutputStream to write to.
* @throws IOException if the writer fails to write.
*/
public void write(List<DoiStatus> doiStatusList, OutputStream out) throws IOException {
OutputStreamWriter outWriter;
Expand All @@ -117,10 +114,9 @@ public void write(List<DoiStatus> doiStatusList, OutputStream out) throws IOExce
/**
* Write a list of DoiStatus instances to a StringBuilder.
*
* @param doiStatusList
* List of DoiStatus instances to write.
* @param builder
* @throws IOException
* @param doiStatusList List of DoiStatus instances to write.
* @param builder the builder to write to.
* @throws IOException if the writer fails to write.
*/
public void write(List<DoiStatus> doiStatusList, StringBuilder builder) throws IOException {
write(doiStatusList, new StringBuilderWriter(builder));
Expand All @@ -129,12 +125,9 @@ public void write(List<DoiStatus> doiStatusList, StringBuilder builder) throws I
/**
* Write a list of DoiStatus instances to a writer.
*
* @param doiStatusList
* List of DoiStatus instances to write.
* @param writer
* Writer to write to.
* @throws IOException
* if the writer fails to write.
* @param doiStatusList List of DoiStatus instances to write.
* @param writer Writer to write to.
* @throws IOException if the writer fails to write.
*/
public void write(List<DoiStatus> doiStatusList, Writer writer) throws IOException {
long start = System.currentTimeMillis();
Expand All @@ -147,12 +140,9 @@ public void write(List<DoiStatus> doiStatusList, Writer writer) throws IOExcepti
/**
* Write a Document instance by providing the root element to a writer.
*
* @param root
* Root element to write.
* @param writer
* Writer to write to.
* @throws IOException
* if the writer fails to write.
* @param root Root element to write.
* @param writer Writer to write to.
* @throws IOException if the writer fails to write.
*/
protected void write(Element root, Writer writer) throws IOException {
XMLOutputter outputter = new XMLOutputter();
Expand Down
16 changes: 7 additions & 9 deletions doi/src/main/java/ca/nrc/cadc/doi/status/DoiStatusXmlReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ public DoiStatus read(String xml) throws DoiParsingException {
/**
* Construct a DoiStatus instance from a InputStream.
*
* @param in
* InputStream.
* @return DoiStatus object .
* @throws DoiParsingException
* if there is an error parsing the XML.
* @param in InputStream.
* @return DoiStatus object.
* @throws IOException if there is an error reading the InputStream.
* @throws DoiParsingException if there is an error parsing the XML.
*/
public DoiStatus read(InputStream in) throws IOException, DoiParsingException {
if (in == null)
Expand All @@ -140,11 +139,10 @@ public DoiStatus read(InputStream in) throws IOException, DoiParsingException {
/**
* Construct a DoiStatus instance from a Reader.
*
* @param reader
* Reader.
* @param reader Reader.
* @return DoiStatus object containing the status of the specified DOI.
* @throws NodeParsingException
* if there is an error parsing the XML.
* @throws DoiParsingException if there is an error parsing the XML.
* @throws IOException if there is an error reading from the reader.
*/
public DoiStatus read(Reader reader) throws DoiParsingException, IOException {
if (reader == null)
Expand Down
34 changes: 12 additions & 22 deletions doi/src/main/java/ca/nrc/cadc/doi/status/DoiStatusXmlWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,9 @@ public DoiStatusXmlWriter() {
/**
* Write a DoiStatus instance to an OutputStream using UTF-8 encoding.
*
* @param doiStatus
* DoiStatus instance to write.
* @param out
* OutputStream to write to.
* @throws IOException
* if the writer fails to write.
* @param doiStatus DoiStatus instance to write.
* @param out OutputStream to write to.
* @throws IOException if the writer fails to write.
*/
public void write(DoiStatus doiStatus, OutputStream out) throws IOException {
OutputStreamWriter outWriter;
Expand All @@ -116,10 +113,9 @@ public void write(DoiStatus doiStatus, OutputStream out) throws IOException {
/**
* Write a DoiStatus instance to a StringBuilder.
*
* @param doiStatus
* DoiStatus instance to write.
* @param builder
* @throws IOException
* @param doiStatus DoiStatus instance to write.
* @param builder builder to write to.
* @throws IOException if the writer fails to write.
*/
public void write(DoiStatus doiStatus, StringBuilder builder) throws IOException {
write(doiStatus, new StringBuilderWriter(builder));
Expand All @@ -128,12 +124,9 @@ public void write(DoiStatus doiStatus, StringBuilder builder) throws IOException
/**
* Write a DoiStatus instance to a writer.
*
* @param doiStatus
* DoiStatus instance to write.
* @param writer
* Writer to write to.
* @throws IOException
* if the writer fails to write.
* @param doiStatus DoiStatus instance to write.
* @param writer Writer to write to.
* @throws IOException if the writer fails to write.
*/
public void write(DoiStatus doiStatus, Writer writer) throws IOException {
long start = System.currentTimeMillis();
Expand All @@ -146,12 +139,9 @@ public void write(DoiStatus doiStatus, Writer writer) throws IOException {
/**
* Write a Document instance by providing the root element to a writer.
*
* @param root
* Root element to write.
* @param writer
* Writer to write to.
* @throws IOException
* if the writer fails to write.
* @param root Root element to write.
* @param writer Writer to write to.
* @throws IOException if the writer fails to write.
*/
protected void write(Element root, Writer writer) throws IOException {
XMLOutputter outputter = new XMLOutputter();
Expand Down

0 comments on commit b829910

Please sign in to comment.