001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2015 ForgeRock AS. 025 */ 026package org.forgerock.opendj.maven.doc; 027 028import java.util.List; 029 030/** 031 * Represents a command-line tool as used in the configuration for {@see GenerateRefEntriesMojo}. 032 * <br> 033 * Command-line tools are associated with a script name, the Java class of the tool, 034 * and a list of relative paths to hand-written files for trailing sections. 035 * <br> 036 * Trailing section paths are relative to the RefEntry file to write. 037 */ 038public class CommandLineTool { 039 /** The script name. */ 040 private String name; 041 042 /** The tool class. */ 043 private String application; 044 045 /** 046 * Additional paths to DocBook XML {@code RefSect1} documents 047 * to be appended after generated content in reference documentation. 048 * 049 * <br> 050 * 051 * DocBook represents a reference manual page with the {@code RefEntry}. 052 * See <a href="http://www.docbook.org/tdg51/en/html/refentry.html">refentry</a>. 053 * 054 * <br> 055 * 056 * A {@code RefEntry} describing an OpenDJ tool contains 057 * block elements in the following order: 058 * 059 * <pre> 060 * RefMeta 061 * RefNameDiv 062 * RefSynopsisDiv 063 * RefSect1 - Description (generated, potentially with a hand-written supplement) 064 * RefSect1 - Options (generated) 065 * RefSect1 - Subcommands (optional, hand-written intro + generated RefSect2s) 066 * RefSect1 - Filter (optional, hand-written) 067 * RefSect1 - Attribute (optional, hand-written) 068 * RefSect1 - Exit Codes (hand-written) 069 * RefSect1 - Files (optional, hand-written) 070 * RefSect1 - Examples (hand-written) 071 * RefSect1 - See Also (hand-written) 072 * </pre> 073 * 074 * As the trailing RefSect1s following Subcommands are hand-written, 075 * they are included in the generated content as XIncludes elements. 076 * The paths in this case are therefore relative to the current RefEntry. 077 */ 078 private List<String> trailingSectionPaths; 079 080 /** 081 * Returns the script name. 082 * @return The script name. 083 */ 084 public String getName() { 085 return name; 086 } 087 088 /** 089 * Set the script name. 090 * @param name The script name. 091 */ 092 public void setName(final String name) { 093 this.name = name; 094 } 095 096 /** 097 * Returns the tool class. 098 * @return The tool class. 099 */ 100 public String getApplication() { 101 return application; 102 } 103 104 /** 105 * Set the tool class. 106 * @param application The tool class. 107 */ 108 public void setApplication(final String application) { 109 this.application = application; 110 } 111 112 /** 113 * Returns additional paths to DocBook XML {@code RefSect1} documents 114 * to be appended after generated content in reference documentation. 115 * 116 * <br> 117 * 118 * DocBook represents a reference manual page with the {@code RefEntry}. 119 * See <a href="http://www.docbook.org/tdg51/en/html/refentry.html">refentry</a>. 120 * 121 * <br> 122 * 123 * A {@code RefEntry} describing an OpenDJ tool contains 124 * block elements in the following order: 125 * 126 * <pre> 127 * RefMeta 128 * RefNameDiv 129 * RefSynopsisDiv 130 * RefSect1 - Description (generated, potentially with a hand-written supplement) 131 * RefSect1 - Options (generated) 132 * RefSect1 - Subcommands (optional, hand-written intro + generated RefSect2s) 133 * RefSect1 - Filter (optional, hand-written) 134 * RefSect1 - Attribute (optional, hand-written) 135 * RefSect1 - Exit Codes (hand-written) 136 * RefSect1 - Files (optional, hand-written) 137 * RefSect1 - Examples (hand-written) 138 * RefSect1 - See Also (hand-written) 139 * </pre> 140 * 141 * As the trailing RefSect1s following Subcommands are hand-written, 142 * they are included in the generated content as XIncludes elements. 143 * The paths in this case are therefore relative to the current RefEntry. 144 * 145 * @return The relative paths to trailing section files. 146 */ 147 public List<String> getTrailingSectionPaths() { 148 return trailingSectionPaths; 149 } 150 151 /** 152 * Set additional paths to DocBook XML {@code RefSect1} documents. 153 * @param paths The paths relative to the current RefEntry. 154 */ 155 public void setTrailingSectionPaths(final List<String> paths) { 156 this.trailingSectionPaths = paths; 157 } 158 159 /** Whether the tool is enabled. Default: true. */ 160 private boolean enabled = true; 161 162 /** 163 * Returns true if the tool is enabled. 164 * @return true if the tool is enabled. 165 */ 166 public boolean isEnabled() { 167 return enabled; 168 } 169 170 /** 171 * Set to true if the tool is enabled, false otherwise. 172 * @param enabled true if the tool is enabled, false otherwise. 173 */ 174 public void setEnabled(final boolean enabled) { 175 this.enabled = enabled; 176 } 177}