Skip to content

Commit

Permalink
Add since tag for goals parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Jun 20, 2023
1 parent 9407426 commit 20f4ade
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 15 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ public abstract class AbstractXmlMojo extends AbstractMojo {

/**
* Whether to skip execution.
*
* @since 1.0.1
*/
@Parameter(property = "xml.skip", defaultValue = "false")
private boolean skip;

/**
* An XML catalog file, or URL, which is being used to resolve entities. See
* <a href="examples/catalog.html">Catalog files</a>.
*
* @since 1.0
*/
@Parameter
private String[] catalogs;
Expand All @@ -94,6 +98,8 @@ public enum CatalogHandling {
/**
* How to handle entities which cannot be found in any catalog. See
* <a href="common-properties.html">Common Goal Properties</a>.
*
* @since 1.0.2
*/
@Parameter(property = "xml.catalogHandling", defaultValue = "passThrough")
private CatalogHandling catalogHandling;
Expand Down
16 changes: 13 additions & 3 deletions src/main/java/org/codehaus/mojo/xml/CheckFormatMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public boolean hasViolations(File file) {
/**
* The encoding of files included in {@link #formatFileSets}. Note that the
* {@code encoding can be set also per FormatFileSet}.
*
* @since 1.0.1
*/
@Parameter(property = "xml.encoding", defaultValue = "${project.build.sourceEncoding}")
private String encoding;
Expand All @@ -93,19 +95,25 @@ public boolean hasViolations(File file) {
* Tells the mojo what to do in case XML formatting violations are found. if {@code true}, all violations will be
* reported on the console as ERRORs and the build will fail. if {@code false}, all violations will be reported on
* the console as WARNs and the build will proceed further.
*
* @since 1.0.1
*/
@Parameter(property = "xml.failOnFormatViolation", defaultValue = "true")
private boolean failOnFormatViolation;

/**
* File patterns to include. The patterns are relative to the current project's {@code baseDir}.
*
* @since 1.0.1
*/
@Parameter
private List<FormatFileSet> formatFileSets = new ArrayList<FormatFileSet>();

/**
* The number of spaces expected for indentation. Note that {@code indentSize} can be configuread also per
* {@link FormatFileSet}.
*
* @since 1.0.1
*/
@Parameter(property = "xml.indentSize", defaultValue = "2")
private int indentSize;
Expand All @@ -116,6 +124,8 @@ public boolean hasViolations(File file) {
/**
* If set to {@code true}, the result of {@link FormatFileSet#getDefault(String, int)} will be appended to
* {@link #formatFileSets} before the processing.
*
* @since 1.0.1
*/
@Parameter(property = "xml.useDefaultFormatFileSet", defaultValue = "true")
private boolean useDefaultFormatFileSet;
Expand All @@ -133,8 +143,8 @@ public CheckFormatMojo() {
* Checks the formatting of the given {@code file}. The file is read using the given {@code encoding} and the
* violations are reported to the given {@code violationHandler}.
*
* @param file the file to check
* @param encoding the encoding to use for reading the {@code file}
* @param file the file to check
* @param encoding the encoding to use for reading the {@code file}
* @param violationHandler the {@link XmlFormatViolationHandler} to report violations
* @throws MojoExecutionException if there is any lover level exception reading or parsing the file.
*/
Expand Down Expand Up @@ -164,7 +174,7 @@ private void check(File file, String encoding, XmlFormatViolationHandler violati
* Called by Maven for executing the Mojo.
*
* @throws MojoExecutionException Running the Mojo failed.
* @throws MojoFailureException A configuration error was detected.
* @throws MojoFailureException A configuration error was detected.
*/
public void execute() throws MojoExecutionException, MojoFailureException {
if (isSkipping()) {
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/org/codehaus/mojo/xml/TransformMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,25 @@ public class TransformMojo extends AbstractXmlMojo {
/**
* Specifies one or more sets of files, which are being transformed. See
* <a href="transformation.html">Transforming XML Files</a>
*
* @since 1.0
*/
@Parameter
private TransformationSet[] transformationSets;

/**
* Whether creating the transformed files should be forced.
*
* @since 1.0
*/
@Parameter(property = "xml.forceCreation", defaultValue = "false")
private boolean forceCreation;

/**
* Transformer factory use. By default, the systems default transformer factory is used. <b>If you use this feature
* you must use at least jdk 1.6</b>
*
* @since 1.0
*/
@Parameter(property = "xml.transformerFactory")
private String transformerFactory;
Expand Down Expand Up @@ -235,7 +241,7 @@ private static String getAllExMsgs(Throwable ex, boolean includeExName) {
}

/**
* @param files the fileNames or URLs to scan their lastModified timestamp.
* @param files the fileNames or URLs to scan their lastModified timestamp.
* @param oldest if true, returns the latest modificationDate of all files, otherwise returns the earliest.
* @return the older or younger last modification timestamp of all files.
*/
Expand Down
24 changes: 13 additions & 11 deletions src/main/java/org/codehaus/mojo/xml/ValidateMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ public class ValidateMojo extends AbstractXmlMojo {
/**
* Specifies a set of document types, which are being validated. See
* <a href="validation.html">Validating XML Files</a>
*
* @since 1.0
*/
@Parameter
private ValidationSet[] validationSets;

/**
* Reads a validation sets schema.
*
* @param pResolver The resolver to use for loading external entities.
* @param pResolver The resolver to use for loading external entities.
* @param pValidationSet The validation set to configure.
* @return The validation sets schema, if any, or null.
* @throws MojoExecutionException Loading the schema failed.
Expand Down Expand Up @@ -121,10 +123,10 @@ private Schema getSchema(Resolver pResolver, ValidationSet pValidationSet) throw
/**
* Called for parsing or validating a single file.
*
* @param pResolver The resolver to use for loading external entities.
* @param pResolver The resolver to use for loading external entities.
* @param pValidationSet The parsers or validators configuration.
* @param pSchema The schema to use.
* @param pFile The file to parse or validate.
* @param pSchema The schema to use.
* @param pFile The file to parse or validate.
* @throws MojoExecutionException Parsing or validating the file failed.
*/
private void validate(
Expand Down Expand Up @@ -205,11 +207,11 @@ private SAXParserFactory newSAXParserFactory(ValidationSet pValidationSet) {
/**
* Called for validating a single file.
*
* @param pResolver The resolver to use for loading external entities.
* @param pResolver The resolver to use for loading external entities.
* @param pValidationSet The validators configuration.
* @param pFile The file to validate.
* @throws IOException An I/O error occurred.
* @throws SAXException Parsing the file failed.
* @param pFile The file to validate.
* @throws IOException An I/O error occurred.
* @throws SAXException Parsing the file failed.
* @throws ParserConfigurationException Creating an XML parser failed.
*/
private void parse(Resolver pResolver, ValidationSet pValidationSet, File pFile, ErrorHandler errorHandler)
Expand All @@ -225,10 +227,10 @@ private void parse(Resolver pResolver, ValidationSet pValidationSet, File pFile,
/**
* Called for validating a set of XML files against a common schema.
*
* @param pResolver The resolver to use for loading external entities.
* @param pResolver The resolver to use for loading external entities.
* @param pValidationSet The set of XML files to validate.
* @throws MojoExecutionException Validating the set of files failed.
* @throws MojoFailureException A configuration error was detected.
* @throws MojoFailureException A configuration error was detected.
*/
private void validate(Resolver pResolver, ValidationSet pValidationSet, ValidationErrorHandler errorHandler)
throws MojoExecutionException, MojoFailureException {
Expand All @@ -250,7 +252,7 @@ private void validate(Resolver pResolver, ValidationSet pValidationSet, Validati
* Called by Maven for executing the Mojo.
*
* @throws MojoExecutionException Running the Mojo failed.
* @throws MojoFailureException A configuration error was detected.
* @throws MojoFailureException A configuration error was detected.
*/
public void execute() throws MojoExecutionException, MojoFailureException {
if (isSkipping()) {
Expand Down

0 comments on commit 20f4ade

Please sign in to comment.