Skip to content

Commit

Permalink
Complete javadocs documentation for some classes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitakovaliov92 committed Aug 14, 2024
1 parent 12708ae commit 8dae8a1
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
* This file is part of veraPDF Library core, a module of the veraPDF project.
* Copyright (c) 2015-2024, veraPDF Consortium <info@verapdf.org>
* All rights reserved.
*
* <p>
* veraPDF Library core is free software: you can redistribute it and/or modify
* it under the terms of either:
*
* <p>
* The GNU General public license GPLv3+.
* You should have received a copy of the GNU General Public License
* along with veraPDF Library core as the LICENSE.GPL file in the root of the source
* tree. If not, see http://www.gnu.org/licenses/ or
* https://www.gnu.org/licenses/gpl-3.0.en.html.
*
* <p>
* The Mozilla Public License MPLv2+.
* You should have received a copy of the Mozilla Public License along with
* veraPDF Library core as the LICENSE.MPL file in the root of the source tree.
Expand All @@ -26,23 +26,137 @@
* @author Maksim Bezrukov
*/
public interface AnnotationFeaturesObjectAdapter extends FeaturesObjectAdapter {
String getId();
String getPopupId();
Set<String> getFormXObjectsResources();
String getSubtype();
double[] getRectangle();
String getContents();
String getAnnotationName();
String getModifiedDate();
double[] getColor();
boolean isInvisible();
boolean isHidden();
boolean isPrinted();
boolean isNoZoom();
boolean isNoRotate();
boolean isNoView();
boolean isReadOnly();
boolean isLocked();
boolean isToggleNoView();
boolean isLockedContents();

/**
* Gets annotation adapter id.
*
* @return an annotation adapter id
*/
String getId();

/**
* Gets annotation adapter popup id.
*
* @return an annotation adapter popup id
*/
String getPopupId();

/**
* Gets form XObject from annotation.
*
* @return a form XObject
*/
Set<String> getFormXObjectsResources();

/**
* Gets annotation subtype.
*
* @return an annotation subtype
*/
String getSubtype();

/**
* Gets annotation rectangle.
*
* @return an annotation rectangle
*/
double[] getRectangle();

/**
* Gets annotation contents.
*
* @return an annotation contents
*/
String getContents();

/**
* Gets annotation name.
*
* @return an annotation name
*/
String getAnnotationName();

/**
* Gets annotation modified date.
*
* @return an annotation modified date
*/
String getModifiedDate();

/**
* Gets annotation color.
*
* @return an annotation color
*/
double[] getColor();

/**
* Tells whether annotation is invisible.
*
* @return true if annotation is invisible
*/
boolean isInvisible();

/**
* Tells whether annotation is hidden.
*
* @return true if annotation is hidden
*/
boolean isHidden();

/**
* Tells whether annotation is printed.
*
* @return true if annotation is printed
*/
boolean isPrinted();

/**
* Tells whether annotation is no zoom.
*
* @return true if annotation is no zoom
*/
boolean isNoZoom();

/**
* Tells whether annotation is no rotate.
*
* @return true if annotation is no rotate
*/
boolean isNoRotate();

/**
* Tells whether annotation is no view.
*
* @return true if annotation is no view
*/
boolean isNoView();

/**
* Tells whether annotation is read only.
*
* @return true if annotation is read only
*/
boolean isReadOnly();

/**
* Tells whether annotation is locked.
*
* @return true if annotation is locked
*/
boolean isLocked();

/**
* Tells whether annotation is toggle no view.
*
* @return true if annotation is toggle no view
*/
boolean isToggleNoView();

/**
* Tells whether annotation is locked content.
*
* @return true if annotation is locked content
*/
boolean isLockedContents();
}
Original file line number Diff line number Diff line change
Expand Up @@ -311,25 +311,20 @@ public static Rule ruleFromValues(final RuleId id, final String object, final St
/**
* Returns a {@link Rule} instance initialised with the passed values.
*
* @param id
* the {@link RuleId} id for the {@link Rule}
* @param object
* a String that identifies the Object that the rule applies to
* @param deferred
* a Boolean that identifies the deferred property of the rule
* @param description
* a textual description of the {@link Rule}.
* @param test
* a JavaScript expression that is the test carried out on a
* model instance
* @param error
* the {@link ErrorDetails} associated with the{@link Rule}.
* @param references
* a list of further {@link Reference}s for this rule
* @param id the {@link RuleId} id for the {@link Rule}
* @param object a String that identifies the Object that the rule applies to
* @param deferred a Boolean that identifies the deferred property of the rule
* @param tags a String that identifies the tag that the rule applies to
* @param description a textual description of the {@link Rule}.
* @param test a JavaScript expression that is the test carried out on a
* model instance
* @param error the {@link ErrorDetails} associated with the{@link Rule}.
* @param references a list of further {@link Reference}s for this rule
*
* @return a {@link Rule} instance.
* @throws IllegalArgumentException
* if any of the parameters are null or the test, object, or
* description is empty
*
* @throws IllegalArgumentException if any of the parameters are null or the test, object, or
* description is empty
*/
public static Rule ruleFromValues(final RuleId id, final String object, final Boolean deferred, String tags,
final String description, final String test,
Expand Down Expand Up @@ -409,6 +404,7 @@ public static Variable variableFromValues(final String name, final String object
* @param toConvert a {@link ValidationProfile} to convert to an XML String
* @param format set to Boolean.TRUE for pretty formatted XML, Boolean.FALSE
* for no space formatting
* @param fragment a flag to generate document level events
*
* @return a String xml representation of toConvert
*
Expand All @@ -427,18 +423,15 @@ public static String profileToXml(final ValidationProfile toConvert, boolean for
* Convert a {@link ValidationProfile} instance to XML and serialise to the
* {@link OutputStream} <code>forXMLOutput</code>.
*
* @param toConvert
* a {@link ValidationProfile} to convert to an XML String
* @param dest
* an OutputStream used to write the generated XML to
* @param format
* set to Boolean.TRUE for pretty formatted XML, Boolean.FALSE
* for no space formatting
* @throws JAXBException
* thrown by JAXB marshaller if there's an error converting the
* object
* @throws IllegalArgumentException
* if toConvert is null
* @param toConvert a {@link ValidationProfile} to convert to an XML String
* @param dest an OutputStream used to write the generated XML to
* @param format set to Boolean.TRUE for pretty formatted XML, Boolean.FALSE
* for no space formatting
* @param fragment a flag to generate document level events
*
* @throws JAXBException thrown by JAXB marshaller if there's an error converting the
* object
* @throws IllegalArgumentException if toConvert is null
*/
public static void profileToXml(final ValidationProfile toConvert, final OutputStream dest, boolean format,
boolean fragment) throws JAXBException {
Expand Down Expand Up @@ -470,18 +463,15 @@ public static ValidationProfile profileFromXml(final InputStream source) throws
* Convert a {@link ValidationProfile} instance to XML and serialise to the
* {@link Writer} <code>forXMLOutput</code>.
*
* @param toConvert
* a {@link ValidationProfile} to convert to an XML String
* @param dest
* a Writer used to write the generated XML to
* @param format
* set to Boolean.TRUE for pretty formatted XML, Boolean.FALSE
* for no space formatting
* @throws JAXBException
* thrown by JAXB marshaller if there's an error converting the
* object
* @throws IllegalArgumentException
* if toConvert is null
* @param toConvert a {@link ValidationProfile} to convert to an XML String
* @param dest a Writer used to write the generated XML to
* @param format set to Boolean.TRUE for pretty formatted XML, Boolean.FALSE
* for no space formatting
* @param fragment a flag to generate document level events
*
* @throws JAXBException thrown by JAXB marshaller if there's an error converting the
* object
* @throws IllegalArgumentException if toConvert is null
*/
public static void profileToXml(final ValidationProfile toConvert, Writer dest, boolean format, boolean fragment)
throws JAXBException {
Expand Down
64 changes: 41 additions & 23 deletions core/src/main/java/org/verapdf/processor/plugins/Attribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
* This file is part of veraPDF Library core, a module of the veraPDF project.
* Copyright (c) 2015-2024, veraPDF Consortium <info@verapdf.org>
* All rights reserved.
*
* <p>
* veraPDF Library core is free software: you can redistribute it and/or modify
* it under the terms of either:
*
* <p>
* The GNU General public license GPLv3+.
* You should have received a copy of the GNU General Public License
* along with veraPDF Library core as the LICENSE.GPL file in the root of the source
* tree. If not, see http://www.gnu.org/licenses/ or
* https://www.gnu.org/licenses/gpl-3.0.en.html.
*
* <p>
* The Mozilla Public License MPLv2+.
* You should have received a copy of the Mozilla Public License along with
* veraPDF Library core as the LICENSE.MPL file in the root of the source tree.
Expand All @@ -29,29 +29,47 @@
@XmlRootElement(name = "attribute")
public class Attribute {

@XmlAttribute
private final String key;
@XmlAttribute
private final String value;
@XmlAttribute
private final String key;
@XmlAttribute
private final String value;

private Attribute(String key, String value) {
this.key = key;
this.value = value;
}
private Attribute(String key, String value) {
this.key = key;
this.value = value;
}

private Attribute() {
this("", "");
}
private Attribute() {
this("", "");
}

public static Attribute fromValues(String key, String value) {
return new Attribute(key, value);
}
/**
* Creates attribute key and value.
*
* @param key an attribute key
* @param value an attribute value
*
* @return an attribute a pair of key and value
*/
public static Attribute fromValues(String key, String value) {
return new Attribute(key, value);
}

public String getKey() {
return key;
}
/**
* Gets attribute key.
*
* @return an attribute key
*/
public String getKey() {
return key;
}

public String getValue() {
return value;
}
/**
* Gets attribute value.
*
* @return an attribute value
*/
public String getValue() {
return value;
}
}
Loading

0 comments on commit 8dae8a1

Please sign in to comment.