Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 45646 invoked from network); 9 Sep 2002 16:44:36 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Sep 2002 16:44:36 -0000 Received: (qmail 24987 invoked by uid 97); 9 Sep 2002 16:45:09 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 24916 invoked by uid 97); 9 Sep 2002 16:45:09 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 24854 invoked by uid 97); 9 Sep 2002 16:45:08 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 9 Sep 2002 16:44:28 -0000 Message-ID: <20020909164428.24062.qmail@icarus.apache.org> From: stevel@apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional XMLValidateTask.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N stevel 2002/09/09 09:44:28 Modified: src/main/org/apache/tools/ant/taskdefs/optional XMLValidateTask.java Log: rolling back feature support till it works on 1.1 and looks more like xstyle Revision Changes Path 1.25 +12 -75 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java Index: XMLValidateTask.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- XMLValidateTask.java 9 Sep 2002 02:50:17 -0000 1.24 +++ XMLValidateTask.java 9 Sep 2002 16:44:28 -0000 1.25 @@ -58,10 +58,9 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.util.Enumeration; +import java.util.Hashtable; import java.util.Vector; -import java.util.List; -import java.util.LinkedList; - import org.apache.tools.ant.AntClassLoader; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; @@ -90,8 +89,6 @@ * (probably the one that is used by Ant itself), but one can specify any * SAX1/2 parser if needed * @author Raphael Pierquin raphael.pierquin@agisphere.com - * @author Nick Pellow - * Added support for setting features. */ public class XMLValidateTask extends Task { @@ -109,7 +106,8 @@ protected Vector filesets = new Vector(); // sets of file to be validated protected Path classpath; - /** + + /** * the parser is viewed as a SAX2 XMLReader. If a SAX1 parser is specified, * it's wrapped in an adapter that make it behave as a XMLReader. * a more 'standard' way of doing this would be to use the JAXP1.1 SAXParser @@ -118,8 +116,7 @@ protected XMLReader xmlReader = null; // XMLReader used to validation process protected ValidatorErrorHandler errorHandler = new ValidatorErrorHandler(); // to report sax parsing errors - - private List featureList = new LinkedList(); + protected Hashtable features = new Hashtable(); private XMLCatalog xmlCatalog = new XMLCatalog(); @@ -225,17 +222,6 @@ filesets.addElement(set); } - - /** - * add a feature nested element - * @since ant1.6 - */ - public Feature createFeature() { - final Feature feature = new Feature(); - featureList.add(feature); - return feature; - } - public void init() throws BuildException { super.init(); xmlCatalog.setProject(getProject()); @@ -361,18 +347,18 @@ + " doesn't provide validation"); } } - // set the feature from the feature list - for (int i = 0; i < featureList.size(); i++) { - Feature feature = (Feature) featureList.get(i); - setFeature(feature.getFeatureName(), - feature.getFeatureValue(), - true); + // set other features + Enumeration enum = features.keys(); + while (enum.hasMoreElements()) { + String featureId = (String) enum.nextElement(); + setFeature(featureId, ((Boolean) features.get(featureId)).booleanValue(), true); } } } /** - * Set a feature on the parser. + * set a feature on the parser. + * @todo find a way to set any feature from build.xml */ private boolean setFeature(String feature, boolean value, boolean warn) { @@ -494,55 +480,6 @@ } } return e.getMessage(); - } - } - - /** - * The class to create to set a feature of the parser. - * @since ant1.6 - * @author Nick Pellow - */ - public class Feature { - /** The name of the feature to set. - * - * Valid features include. - */ - private String featureName = null; - - /** - * The value of the feature. - **/ - private boolean featureValue; - - /** - * Set the feature name. - * @param name the name to set - */ - public void setName(String name) { - featureName = name; - } - /** - * Set the feature value to true or false. - * @param value - */ - public void setValue(boolean value) { - featureValue = value; - } - - /** - * Gets the feature name. - * @return the feature name - */ - public String getFeatureName() { - return featureName; - } - - /** - * Gets the feature value. - * @return the featuree value - */ - public boolean getFeatureValue() { - return featureValue; } } } -- To unsubscribe, e-mail: For additional commands, e-mail: