You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2006/11/11 23:39:20 UTC
svn commit: r473822 - in
/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional:
Native2Ascii.java PropertyFile.java SchemaValidate.java
Author: peterreilly
Date: Sat Nov 11 14:39:19 2006
New Revision: 473822
URL: http://svn.apache.org/viewvc?view=rev&rev=473822
Log:
javadoc
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java?view=diff&rev=473822&r1=473821&r2=473822
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java Sat Nov 11 14:39:19 2006
@@ -48,6 +48,7 @@
private Mapper mapper;
private FacadeTaskHelper facade = null;
+ /** No args constructor */
public Native2Ascii() {
facade = new FacadeTaskHelper(Native2AsciiAdapterFactory.getDefault());
}
@@ -65,7 +66,7 @@
/**
* The value of the reverse attribute.
- *
+ * @return the reverse attribute.
* @since Ant 1.6.3
*/
public boolean getReverse() {
@@ -84,8 +85,8 @@
}
/**
- * The value of the reverse attribute.
- *
+ * The value of the encoding attribute.
+ * @return the encoding attribute.
* @since Ant 1.6.3
*/
public String getEncoding() {
@@ -272,7 +273,7 @@
/**
* Returns the (implementation specific) settings given as nested
* arg elements.
- *
+ * @return the arguments.
* @since Ant 1.6.3
*/
public String[] getCurrentArgs() {
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java?view=diff&rev=473822&r1=473821&r2=473822
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java Sat Nov 11 14:39:19 2006
@@ -131,6 +131,10 @@
* Methods
*/
+ /**
+ * Execute the task.
+ * @throws BuildException on error.
+ */
public void execute() throws BuildException {
checkParameters();
readFile();
@@ -138,6 +142,10 @@
writeFile();
}
+ /**
+ * The entry nested element.
+ * @return an entry nested element to be configured.
+ */
public Entry createEntry() {
Entry e = new Entry();
entries.addElement(e);
@@ -194,6 +202,7 @@
/**
* Location of the property file to be edited; required.
+ * @param file the property file.
*/
public void setFile(File file) {
propertyfile = file;
@@ -201,6 +210,7 @@
/**
* optional header comment for the file
+ * @param hdr the string to use for the comment.
*/
public void setComment(String hdr) {
comment = hdr;
@@ -242,6 +252,7 @@
/**
* Name of the property name/value pair
+ * @param value the key.
*/
public void setKey(String value) {
this.key = value;
@@ -249,6 +260,7 @@
/**
* Value to set (=), to add (+) or subtract (-)
+ * @param value the value.
*/
public void setValue(String value) {
this.value = value;
@@ -258,6 +270,7 @@
* operation to apply.
* "+" or "="
*(default) for all datatypes; "-" for date and int only)\.
+ * @param value the operation enumerated value.
*/
public void setOperation(Operation value) {
this.operation = Operation.toOperation(value.getValue());
@@ -265,6 +278,7 @@
/**
* Regard the value as : int, date or string (default)
+ * @param value the type enumerated value.
*/
public void setType(Type value) {
this.type = Type.toType(value.getValue());
@@ -274,8 +288,8 @@
* Initial value to set for a property if it is not
* already defined in the property file.
* For type date, an additional keyword is allowed: "now"
+ * @param value the default value.
*/
-
public void setDefault(String value) {
this.defaultValue = value;
}
@@ -283,6 +297,7 @@
/**
* For int and date type only. If present, Values will
* be parsed and formatted accordingly.
+ * @param value the pattern to use.
*/
public void setPattern(String value) {
this.pattern = value;
@@ -302,6 +317,7 @@
* <li>year</li>
* </ul>
* This only applies to date types using a +/- operation.
+ * @param unit the unit enumerated value.
* @since Ant 1.5
*/
public void setUnit(PropertyFile.Unit unit) {
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java?view=diff&rev=473822&r1=473821&r2=473822
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/SchemaValidate.java Sat Nov 11 14:39:19 2006
@@ -21,7 +21,6 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.XmlConstants;
-import org.apache.tools.ant.util.JAXPUtils;
import org.xml.sax.XMLReader;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
@@ -65,17 +64,28 @@
*/
private SchemaLocation anonymousSchema;
+ // Error strings
+ /** SAX1 not supported */
public static final String ERROR_SAX_1 = "SAX1 parsers are not supported";
- public static final String ERROR_NO_XSD_SUPPORT = "Parser does not support Xerces or JAXP schema features";
-
- public static final String ERROR_TOO_MANY_DEFAULT_SCHEMAS = "Only one of defaultSchemaFile and defaultSchemaURL allowed";
-
- public static final String ERROR_PARSER_CREATION_FAILURE = "Could not create parser";
+ /** schema features not supported */
+ public static final String ERROR_NO_XSD_SUPPORT
+ = "Parser does not support Xerces or JAXP schema features";
+
+ /** too many default schemas */
+ public static final String ERROR_TOO_MANY_DEFAULT_SCHEMAS
+ = "Only one of defaultSchemaFile and defaultSchemaURL allowed";
+
+ /** unable to create parser */
+ public static final String ERROR_PARSER_CREATION_FAILURE
+ = "Could not create parser";
+ /** adding schema */
public static final String MESSAGE_ADDING_SCHEMA = "Adding schema ";
- public static final String ERROR_DUPLICATE_SCHEMA = "Duplicate declaration of schema ";
+ /** Duplicate declaration of schema */
+ public static final String ERROR_DUPLICATE_SCHEMA
+ = "Duplicate declaration of schema ";
/**
* Called by the project to let the task initialize properly. The default
@@ -137,7 +147,7 @@
/**
* add the schema
- * @param location
+ * @param location the schema location.
* @throws BuildException if there is no namespace, or if there already
* is a declaration of this schema with a different value
*/
@@ -153,7 +163,7 @@
/**
* enable full schema checking. Slower but better.
- * @param fullChecking
+ * @param fullChecking a <code>boolean</code> value.
*/
public void setFullChecking(boolean fullChecking) {
this.fullChecking = fullChecking;
@@ -172,7 +182,7 @@
/**
* identify the URL of the default schema
- * @param defaultSchemaURL
+ * @param defaultSchemaURL the URL of the default schema.
*/
public void setNoNamespaceURL(String defaultSchemaURL) {
createAnonymousSchema();
@@ -181,7 +191,7 @@
/**
* identify a file containing the default schema
- * @param defaultSchemaFile
+ * @param defaultSchemaFile the location of the default schema.
*/
public void setNoNamespaceFile(File defaultSchemaFile) {
createAnonymousSchema();
@@ -190,7 +200,7 @@
/**
* flag to disable DTD support.
- * @param disableDTD
+ * @param disableDTD a <code>boolean</code> value.
*/
public void setDisableDTD(boolean disableDTD) {
this.disableDTD = disableDTD;
@@ -288,8 +298,8 @@
/**
* set a feature if it is supported, log at verbose level if
* not
- * @param feature
- * @param value
+ * @param feature the feature.
+ * @param value a <code>boolean</code> value.
*/
protected void setFeatureIfSupported(String feature, boolean value) {
try {
@@ -321,31 +331,48 @@
private String url;
+ /** No namespace URI */
public static final String ERROR_NO_URI = "No namespace URI";
- public static final String ERROR_TWO_LOCATIONS = "Both URL and File were given for schema ";
+ /** Both URL and File were given for schema */
+ public static final String ERROR_TWO_LOCATIONS
+ = "Both URL and File were given for schema ";
+ /** File not found */
public static final String ERROR_NO_FILE = "File not found: ";
- public static final String ERROR_NO_URL_REPRESENTATION = "Cannot make a URL of ";
-
- public static final String ERROR_NO_LOCATION = "No file or URL supplied for the schema ";
+ /** Cannot make URL */
+ public static final String ERROR_NO_URL_REPRESENTATION
+ = "Cannot make a URL of ";
+
+ /** No location provided */
+ public static final String ERROR_NO_LOCATION
+ = "No file or URL supplied for the schema ";
+ /** No arg constructor */
public SchemaLocation() {
}
+ /**
+ * Get the namespace.
+ * @return the namespace.
+ */
public String getNamespace() {
return namespace;
}
/**
* set the namespace of this schema. Any URI
- * @param namespace
+ * @param namespace the namespace to use.
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
+ /**
+ * Get the file.
+ * @return the file containing the schema.
+ */
public File getFile() {
return file;
}
@@ -353,19 +380,23 @@
/**
* identify a file that contains this namespace's schema.
* The file must exist.
- * @param file
+ * @param file the file contains the schema.
*/
public void setFile(File file) {
this.file = file;
}
+ /**
+ * The URL containing the schema.
+ * @return the URL string.
+ */
public String getUrl() {
return url;
}
/**
* identify a URL that hosts the schema.
- * @param url
+ * @param url the URL string.
*/
public void setUrl(String url) {
this.url = url;
@@ -406,7 +437,7 @@
* validate the fields then create a "uri location" string
*
* @return string of uri and location
- * @throws BuildException
+ * @throws BuildException if there is an error.
*/
public String getURIandLocation() throws BuildException {
validateNamespace();
@@ -466,6 +497,10 @@
return true;
}
+ /**
+ * Generate a hashcode depending on the namespace, url and file name.
+ * @return the hashcode.
+ */
public int hashCode() {
int result;
result = (namespace != null ? namespace.hashCode() : 0);
@@ -488,4 +523,4 @@
return buffer.toString();
}
} //SchemaLocation
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org