You are viewing a plain text version of this content. The canonical link for it is here.
Posted to easyant-commits@incubator.apache.org by hi...@apache.org on 2011/02/22 15:56:09 UTC
svn commit: r1073371 [15/28] - in /incubator/easyant/core/trunk: ./ bin/
example/build-configurations/
example/build-configurations/src/main/java/org/apache/easyant/example/
example/build-configurations/src/test/java/org/apache/easyant/example/
example...
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/EasyAntReport.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/EasyAntReport.java?rev=1073371&r1=1073370&r2=1073371&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/EasyAntReport.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/EasyAntReport.java Tue Feb 22 15:55:55 2011
@@ -33,407 +33,407 @@ import org.apache.ivy.core.report.Resolv
*/
public class EasyAntReport {
- private List<TargetReport> targetReports;
- private List<PhaseReport> phaseReports;
- private List<ParameterReport> parameterReports;
- private List<ImportedModuleReport> importedModuleReports;
- private Map<String, PropertyDescriptor> propertyReports;
- private ResolveReport resolveReport;
-
- /**
- * Default Constructor
- */
- public EasyAntReport() {
- super();
- targetReports = new ArrayList<TargetReport>();
- phaseReports = new ArrayList<PhaseReport>();
- parameterReports = new ArrayList<ParameterReport>();
- importedModuleReports = new ArrayList<ImportedModuleReport>();
- propertyReports = new HashMap<String, PropertyDescriptor>();
- }
-
- /**
- * Get a list of targets available in this module
- *
- * @return
- */
- public List<TargetReport> getTargetReports() {
- return Collections.unmodifiableList(targetReports);
- }
-
- public TargetReport getTargetReport(String name) {
- if (name == null || name.equals("")) {
- throw new IllegalArgumentException("target name cannot be null");
- }
- for (TargetReport target : targetReports) {
- if (target.getName().equals(name)) {
- return target;
- }
- }
- return null;
- }
-
- public TargetReport getTargetReport(String name, boolean includeImports) {
- TargetReport retVal = getTargetReport(name);
- if(retVal == null && includeImports) {
- List<TargetReport> targets = getAvailableTargets();
- for(TargetReport target : targets) {
- if (target.getName().equals(name)) {
- retVal = target;
- }
- }
- }
- return retVal;
- }
-
- /**
- * Add a given targetReport to the list of know target
- *
- * @param targetReport
- * a given targeReport
- */
- public void addTargetReport(TargetReport targetReport) {
- if (targetReport == null) {
- throw new IllegalArgumentException("targetReport cannot be null");
- }
- targetReports.add(targetReport);
- }
-
- /**
- * Get a phase by its name Return null if no phaseReport where found with
- * this name
- *
- * @param name
- * represent the phase name
- * @return a phase report
- */
- public PhaseReport getPhaseReport(String name) {
- if (name == null || name.equals("")) {
- throw new IllegalArgumentException("phase name cannot be null");
- }
- for (PhaseReport phase : phaseReports) {
- if (phase.getName().equals(name)) {
- return phase;
- }
- }
- return null;
- }
-
- /**
- * Get a phase by its name Return null if no phaseReport where found with
- * this name. The includeImports parameters can be additionally used to
- * extend the search to include imports by the current module.
- *
- * @param name
- * represent the phase name
- * @param includeImports
- * should the method search included modules
- * @return a phase report
- */
- public PhaseReport getPhaseReport(String name, boolean includeImports) {
- PhaseReport retVal = getPhaseReport(name);
- if(includeImports && retVal == null) {
- List<PhaseReport> phases = getAvailablePhases();
- for(PhaseReport phase : phases) {
- if (phase.getName().equals(name)) {
- retVal = phase;
- }
- }
- }
- return retVal;
- }
-
- /**
- * Get a list of phases available in this module
- *
- * @return a list of phases
- */
- public List<PhaseReport> getPhaseReports() {
- return Collections.unmodifiableList(phaseReports);
- }
-
- /**
- * Add a given phaseReport
- *
- * @param phaseReport
- * a given phaseReport
- */
- public void addPhaseReport(PhaseReport phaseReport) {
- if (phaseReport == null) {
- throw new IllegalArgumentException("phaseReport cannot be null");
- }
- phaseReports.add(phaseReport);
- }
-
- /**
- * Get a list of all parameters defined in this module
- *
- * @return a list of parameters
- */
- public List<ParameterReport> getParameterReports() {
- return Collections.unmodifiableList(parameterReports);
- }
-
- /**
- * Add a parameterReport
- *
- * @param parameterReport
- * a parameterReport
- */
- public void addParameterReport(ParameterReport parameterReport) {
- if (parameterReport == null) {
- throw new IllegalArgumentException("parameterReport cannot be null");
- }
- parameterReports.add(parameterReport);
- }
-
- /**
- * Get a list of all imported modules
- *
- * @return a list of imported modules
- */
- public List<ImportedModuleReport> getImportedModuleReports() {
- return Collections.unmodifiableList(importedModuleReports);
- }
-
- /**
- * Returns the imported module indicated by the passed parameter.
- *
- * The method attempts to match either the complete module id
- * or the module alias as specified in the build module.
- *
- * @param module
- * name of the module - either module id or the module alias.
- *
- * @return
- * instance of the exact module report queried for, if such a
- * module exists. it returns null otherwise.
- */
- public ImportedModuleReport getImportedModuleReport(String module) {
- if(module.indexOf(';') > 0) {
- module = module.substring(0, module.indexOf(';'));
- }
- ImportedModuleReport retVal = null;
- for(ImportedModuleReport moduleRep : importedModuleReports) {
- if(moduleRep.moduleMrid.startsWith(module)) {
- retVal = moduleRep;
- break;
- } else if(moduleRep.as != null && moduleRep.as.equals(module)) {
- retVal = moduleRep;
- break;
- }
- }
- return retVal;
- }
-
- /**
- * Add an imported module
- *
- * @param importedModuleReport
- * a report that represent the importedModule
- */
- public void addImportedModuleReport(
- ImportedModuleReport importedModuleReport) {
- if (importedModuleReport == null) {
- throw new IllegalArgumentException(
- "importedModuleReport cannot be null");
- }
- importedModuleReports.add(importedModuleReport);
- }
-
- /**
- * Get the related ivyReport
- *
- * @return the resolveReport
- */
- public ResolveReport getResolveReport() {
- return resolveReport;
- }
-
- /**
- * Set the related ivyReport
- *
- * @param resolveReport
- * a resolveReport
- */
- public void setResolveReport(ResolveReport resolveReport) {
- this.resolveReport = resolveReport;
- }
-
- /**
- * Add a property
- *
- * @param propertyName
- * the property name
- * @param propertyDescriptor
- * a property descriptor that contains several info on the
- * propery (description / required or not etc...)
- */
- public void addPropertyDescriptor(String propertyName,
- PropertyDescriptor propertyDescriptor) {
- if (propertyName == null || propertyDescriptor == null) {
- throw new IllegalArgumentException(
- "propertyName and propertyDescriptor cannot be null");
- }
- this.propertyReports.put(propertyName, propertyDescriptor);
- }
-
- /**
- * Add all properties contained in an other propertyDescriptor
- *
- * @param properties
- * a map of propertyDescriptor to inject
- */
- public void addAllPropertyDescriptor(
- Map<String, PropertyDescriptor> properties) {
- if (properties == null) {
- throw new IllegalArgumentException("properties cannot be null");
- }
- this.propertyReports.putAll(properties);
- }
-
- /**
- * Return a map of the properties
- *
- * @return a map of the properties
- */
- public Map<String, PropertyDescriptor> getPropertyDescriptors() {
- return Collections.unmodifiableMap(propertyReports);
- }
-
- /**
- * Get a list of all the properties available in this module or in all imported modules
- * @return a list of all the properties available in this module or in all imported modules
- */
- public Map<String, PropertyDescriptor> getAvailableProperties() {
- Map<String, PropertyDescriptor> availableProperties = new HashMap<String, PropertyDescriptor>();
-
- if (propertyReports != null) {
- availableProperties.putAll(propertyReports);
- }
- if (importedModuleReports != null) {
- for (ImportedModuleReport importedModuleReport : importedModuleReports) {
- if (importedModuleReport.getEasyantReport() != null) {
- Map<String, PropertyDescriptor> subproperties = importedModuleReport
- .getEasyantReport().getAvailableProperties();
- for (Iterator iterator = subproperties.keySet().iterator(); iterator
- .hasNext();) {
- String propName = (String) iterator.next();
- PropertyDescriptor propertyToInsert = (PropertyDescriptor) subproperties
- .get(propName);
- if (availableProperties.containsKey(propName)) {
- PropertyDescriptor propertyDescriptor = (PropertyDescriptor) availableProperties
- .get(propName);
-
- if (propertyDescriptor.getDescription() == null
- && propertyToInsert.getDescription() != null) {
- propertyDescriptor
- .setDescription(propertyToInsert
- .getDescription());
- propertyDescriptor.setRequired(propertyToInsert
- .isRequired());
- propertyDescriptor
- .setDefaultValue(propertyToInsert
- .getDefaultValue());
- availableProperties.put(propName,
- propertyDescriptor);
- }
-
- } else
- availableProperties.put(propName, propertyToInsert);
-
- }
-
- }
- }
- }
- return availableProperties;
- }
-
- /**
- * This utilitary function allow us to retrieve a list of all targetReport
- * available in this module and in all imported subModules
- *
- * @return a list of all TargetReport available in the module or in its
- * submodules
- */
- public List<TargetReport> getAvailableTargets() {
- List<TargetReport> targets = new ArrayList<TargetReport>();
- targets.addAll(targetReports);
- for (ImportedModuleReport importedModuleReport : importedModuleReports) {
- if (importedModuleReport.getEasyantReport() != null)
- for (TargetReport targetReport : importedModuleReport
- .getEasyantReport().getAvailableTargets()) {
- TargetReport target = new TargetReport();
- if (importedModuleReport.getAs() == null)
- targets.add(targetReport);
- else {
- target.setName(importedModuleReport.getAs()
- + targetReport.getName());
- target.setDepends(targetReport.getDepends());
- target.setIfCase(targetReport.getIfCase());
- target.setUnlessCase(targetReport.getUnlessCase());
- target.setPhase(targetReport.getPhase());
- targets.add(target);
- }
- }
-
- }
-
- return targets;
-
- }
-
- /**
- * Return a list of target that are not bound to any phases
- */
- public List<TargetReport> getUnboundTargets() {
- List<TargetReport> targets = new ArrayList<TargetReport>();
- for (TargetReport targetReport : getAvailableTargets()) {
- if (targetReport.getPhase() == null) {
- targets.add(targetReport);
- }
- }
- return targets;
- }
-
- private List<PhaseReport> getAvailablePhasesWithoutTarget() {
- List<PhaseReport> phases = new ArrayList<PhaseReport>();
-
- phases.addAll(phaseReports);
- for (ImportedModuleReport importedModuleReport : importedModuleReports) {
- if (importedModuleReport.getEasyantReport() != null) {
- phases.addAll(importedModuleReport.getEasyantReport()
- .getAvailablePhasesWithoutTarget());
- }
- }
- return phases;
- }
-
- /**
- * This utilitary function allow us to retrieve a list of all phaseReport
- * available in this module and in all imported subModules
- *
- * @return a list of all PhaseReport available in the module or in its
- * submodules
- */
- public List<PhaseReport> getAvailablePhases() {
- List<PhaseReport> phases = getAvailablePhasesWithoutTarget();
-
- // associate target to the phase
- List<TargetReport> targets = getAvailableTargets();
- for (int i = 0; i < phases.size(); i++) {
- PhaseReport phase = phases.get(i);
- for (TargetReport target : targets) {
- if (target.getPhase() != null
- && target.getPhase().equals(phase.getName())) {
- phase.addTargetReport(target);
- phases.set(i, phase);
- }
- }
- }
+ private List<TargetReport> targetReports;
+ private List<PhaseReport> phaseReports;
+ private List<ParameterReport> parameterReports;
+ private List<ImportedModuleReport> importedModuleReports;
+ private Map<String, PropertyDescriptor> propertyReports;
+ private ResolveReport resolveReport;
+
+ /**
+ * Default Constructor
+ */
+ public EasyAntReport() {
+ super();
+ targetReports = new ArrayList<TargetReport>();
+ phaseReports = new ArrayList<PhaseReport>();
+ parameterReports = new ArrayList<ParameterReport>();
+ importedModuleReports = new ArrayList<ImportedModuleReport>();
+ propertyReports = new HashMap<String, PropertyDescriptor>();
+ }
+
+ /**
+ * Get a list of targets available in this module
+ *
+ * @return
+ */
+ public List<TargetReport> getTargetReports() {
+ return Collections.unmodifiableList(targetReports);
+ }
+
+ public TargetReport getTargetReport(String name) {
+ if (name == null || name.equals("")) {
+ throw new IllegalArgumentException("target name cannot be null");
+ }
+ for (TargetReport target : targetReports) {
+ if (target.getName().equals(name)) {
+ return target;
+ }
+ }
+ return null;
+ }
+
+ public TargetReport getTargetReport(String name, boolean includeImports) {
+ TargetReport retVal = getTargetReport(name);
+ if(retVal == null && includeImports) {
+ List<TargetReport> targets = getAvailableTargets();
+ for(TargetReport target : targets) {
+ if (target.getName().equals(name)) {
+ retVal = target;
+ }
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Add a given targetReport to the list of know target
+ *
+ * @param targetReport
+ * a given targeReport
+ */
+ public void addTargetReport(TargetReport targetReport) {
+ if (targetReport == null) {
+ throw new IllegalArgumentException("targetReport cannot be null");
+ }
+ targetReports.add(targetReport);
+ }
+
+ /**
+ * Get a phase by its name Return null if no phaseReport where found with
+ * this name
+ *
+ * @param name
+ * represent the phase name
+ * @return a phase report
+ */
+ public PhaseReport getPhaseReport(String name) {
+ if (name == null || name.equals("")) {
+ throw new IllegalArgumentException("phase name cannot be null");
+ }
+ for (PhaseReport phase : phaseReports) {
+ if (phase.getName().equals(name)) {
+ return phase;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get a phase by its name Return null if no phaseReport where found with
+ * this name. The includeImports parameters can be additionally used to
+ * extend the search to include imports by the current module.
+ *
+ * @param name
+ * represent the phase name
+ * @param includeImports
+ * should the method search included modules
+ * @return a phase report
+ */
+ public PhaseReport getPhaseReport(String name, boolean includeImports) {
+ PhaseReport retVal = getPhaseReport(name);
+ if(includeImports && retVal == null) {
+ List<PhaseReport> phases = getAvailablePhases();
+ for(PhaseReport phase : phases) {
+ if (phase.getName().equals(name)) {
+ retVal = phase;
+ }
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Get a list of phases available in this module
+ *
+ * @return a list of phases
+ */
+ public List<PhaseReport> getPhaseReports() {
+ return Collections.unmodifiableList(phaseReports);
+ }
+
+ /**
+ * Add a given phaseReport
+ *
+ * @param phaseReport
+ * a given phaseReport
+ */
+ public void addPhaseReport(PhaseReport phaseReport) {
+ if (phaseReport == null) {
+ throw new IllegalArgumentException("phaseReport cannot be null");
+ }
+ phaseReports.add(phaseReport);
+ }
+
+ /**
+ * Get a list of all parameters defined in this module
+ *
+ * @return a list of parameters
+ */
+ public List<ParameterReport> getParameterReports() {
+ return Collections.unmodifiableList(parameterReports);
+ }
+
+ /**
+ * Add a parameterReport
+ *
+ * @param parameterReport
+ * a parameterReport
+ */
+ public void addParameterReport(ParameterReport parameterReport) {
+ if (parameterReport == null) {
+ throw new IllegalArgumentException("parameterReport cannot be null");
+ }
+ parameterReports.add(parameterReport);
+ }
+
+ /**
+ * Get a list of all imported modules
+ *
+ * @return a list of imported modules
+ */
+ public List<ImportedModuleReport> getImportedModuleReports() {
+ return Collections.unmodifiableList(importedModuleReports);
+ }
+
+ /**
+ * Returns the imported module indicated by the passed parameter.
+ *
+ * The method attempts to match either the complete module id
+ * or the module alias as specified in the build module.
+ *
+ * @param module
+ * name of the module - either module id or the module alias.
+ *
+ * @return
+ * instance of the exact module report queried for, if such a
+ * module exists. it returns null otherwise.
+ */
+ public ImportedModuleReport getImportedModuleReport(String module) {
+ if(module.indexOf(';') > 0) {
+ module = module.substring(0, module.indexOf(';'));
+ }
+ ImportedModuleReport retVal = null;
+ for(ImportedModuleReport moduleRep : importedModuleReports) {
+ if(moduleRep.moduleMrid.startsWith(module)) {
+ retVal = moduleRep;
+ break;
+ } else if(moduleRep.as != null && moduleRep.as.equals(module)) {
+ retVal = moduleRep;
+ break;
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Add an imported module
+ *
+ * @param importedModuleReport
+ * a report that represent the importedModule
+ */
+ public void addImportedModuleReport(
+ ImportedModuleReport importedModuleReport) {
+ if (importedModuleReport == null) {
+ throw new IllegalArgumentException(
+ "importedModuleReport cannot be null");
+ }
+ importedModuleReports.add(importedModuleReport);
+ }
+
+ /**
+ * Get the related ivyReport
+ *
+ * @return the resolveReport
+ */
+ public ResolveReport getResolveReport() {
+ return resolveReport;
+ }
+
+ /**
+ * Set the related ivyReport
+ *
+ * @param resolveReport
+ * a resolveReport
+ */
+ public void setResolveReport(ResolveReport resolveReport) {
+ this.resolveReport = resolveReport;
+ }
+
+ /**
+ * Add a property
+ *
+ * @param propertyName
+ * the property name
+ * @param propertyDescriptor
+ * a property descriptor that contains several info on the
+ * propery (description / required or not etc...)
+ */
+ public void addPropertyDescriptor(String propertyName,
+ PropertyDescriptor propertyDescriptor) {
+ if (propertyName == null || propertyDescriptor == null) {
+ throw new IllegalArgumentException(
+ "propertyName and propertyDescriptor cannot be null");
+ }
+ this.propertyReports.put(propertyName, propertyDescriptor);
+ }
+
+ /**
+ * Add all properties contained in an other propertyDescriptor
+ *
+ * @param properties
+ * a map of propertyDescriptor to inject
+ */
+ public void addAllPropertyDescriptor(
+ Map<String, PropertyDescriptor> properties) {
+ if (properties == null) {
+ throw new IllegalArgumentException("properties cannot be null");
+ }
+ this.propertyReports.putAll(properties);
+ }
+
+ /**
+ * Return a map of the properties
+ *
+ * @return a map of the properties
+ */
+ public Map<String, PropertyDescriptor> getPropertyDescriptors() {
+ return Collections.unmodifiableMap(propertyReports);
+ }
+
+ /**
+ * Get a list of all the properties available in this module or in all imported modules
+ * @return a list of all the properties available in this module or in all imported modules
+ */
+ public Map<String, PropertyDescriptor> getAvailableProperties() {
+ Map<String, PropertyDescriptor> availableProperties = new HashMap<String, PropertyDescriptor>();
+
+ if (propertyReports != null) {
+ availableProperties.putAll(propertyReports);
+ }
+ if (importedModuleReports != null) {
+ for (ImportedModuleReport importedModuleReport : importedModuleReports) {
+ if (importedModuleReport.getEasyantReport() != null) {
+ Map<String, PropertyDescriptor> subproperties = importedModuleReport
+ .getEasyantReport().getAvailableProperties();
+ for (Iterator iterator = subproperties.keySet().iterator(); iterator
+ .hasNext();) {
+ String propName = (String) iterator.next();
+ PropertyDescriptor propertyToInsert = (PropertyDescriptor) subproperties
+ .get(propName);
+ if (availableProperties.containsKey(propName)) {
+ PropertyDescriptor propertyDescriptor = (PropertyDescriptor) availableProperties
+ .get(propName);
+
+ if (propertyDescriptor.getDescription() == null
+ && propertyToInsert.getDescription() != null) {
+ propertyDescriptor
+ .setDescription(propertyToInsert
+ .getDescription());
+ propertyDescriptor.setRequired(propertyToInsert
+ .isRequired());
+ propertyDescriptor
+ .setDefaultValue(propertyToInsert
+ .getDefaultValue());
+ availableProperties.put(propName,
+ propertyDescriptor);
+ }
+
+ } else
+ availableProperties.put(propName, propertyToInsert);
+
+ }
+
+ }
+ }
+ }
+ return availableProperties;
+ }
+
+ /**
+ * This utilitary function allow us to retrieve a list of all targetReport
+ * available in this module and in all imported subModules
+ *
+ * @return a list of all TargetReport available in the module or in its
+ * submodules
+ */
+ public List<TargetReport> getAvailableTargets() {
+ List<TargetReport> targets = new ArrayList<TargetReport>();
+ targets.addAll(targetReports);
+ for (ImportedModuleReport importedModuleReport : importedModuleReports) {
+ if (importedModuleReport.getEasyantReport() != null)
+ for (TargetReport targetReport : importedModuleReport
+ .getEasyantReport().getAvailableTargets()) {
+ TargetReport target = new TargetReport();
+ if (importedModuleReport.getAs() == null)
+ targets.add(targetReport);
+ else {
+ target.setName(importedModuleReport.getAs()
+ + targetReport.getName());
+ target.setDepends(targetReport.getDepends());
+ target.setIfCase(targetReport.getIfCase());
+ target.setUnlessCase(targetReport.getUnlessCase());
+ target.setPhase(targetReport.getPhase());
+ targets.add(target);
+ }
+ }
+
+ }
+
+ return targets;
+
+ }
+
+ /**
+ * Return a list of target that are not bound to any phases
+ */
+ public List<TargetReport> getUnboundTargets() {
+ List<TargetReport> targets = new ArrayList<TargetReport>();
+ for (TargetReport targetReport : getAvailableTargets()) {
+ if (targetReport.getPhase() == null) {
+ targets.add(targetReport);
+ }
+ }
+ return targets;
+ }
+
+ private List<PhaseReport> getAvailablePhasesWithoutTarget() {
+ List<PhaseReport> phases = new ArrayList<PhaseReport>();
+
+ phases.addAll(phaseReports);
+ for (ImportedModuleReport importedModuleReport : importedModuleReports) {
+ if (importedModuleReport.getEasyantReport() != null) {
+ phases.addAll(importedModuleReport.getEasyantReport()
+ .getAvailablePhasesWithoutTarget());
+ }
+ }
+ return phases;
+ }
+
+ /**
+ * This utilitary function allow us to retrieve a list of all phaseReport
+ * available in this module and in all imported subModules
+ *
+ * @return a list of all PhaseReport available in the module or in its
+ * submodules
+ */
+ public List<PhaseReport> getAvailablePhases() {
+ List<PhaseReport> phases = getAvailablePhasesWithoutTarget();
+
+ // associate target to the phase
+ List<TargetReport> targets = getAvailableTargets();
+ for (int i = 0; i < phases.size(); i++) {
+ PhaseReport phase = phases.get(i);
+ for (TargetReport target : targets) {
+ if (target.getPhase() != null
+ && target.getPhase().equals(phase.getName())) {
+ phase.addTargetReport(target);
+ phases.set(i, phase);
+ }
+ }
+ }
- return phases;
- }
+ return phases;
+ }
}
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/EasyAntReportModuleParser.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/EasyAntReportModuleParser.java?rev=1073371&r1=1073370&r2=1073371&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/EasyAntReportModuleParser.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/EasyAntReportModuleParser.java Tue Feb 22 15:55:55 2011
@@ -43,274 +43,274 @@ import org.xml.sax.SAXException;
public class EasyAntReportModuleParser extends ContextualSAXHandler {
- private EasyAntReport eaReport;
+ private EasyAntReport eaReport;
- private Map<String, String> properties = new HashMap<String, String>();
+ private Map<String, String> properties = new HashMap<String, String>();
- private String configuration;
- private PropertyDescriptor propertyDescriptor;
+ private String configuration;
+ private PropertyDescriptor propertyDescriptor;
- public EasyAntReportModuleParser(String configuration) {
- super();
- this.configuration = configuration;
- }
-
- public EasyAntReport getEaReport() {
- return eaReport;
- }
-
- public Map<String, String> getProperties() {
- return properties;
- }
-
- @Override
- public void startDocument() throws SAXException {
- super.startDocument();
- eaReport = new EasyAntReport();
- }
-
- @Override
- public void startElement(String uri, String localName, String name,
- Attributes attributes) throws SAXException {
- super.startElement(uri, localName, name, attributes);
-
- if ("project/target".equals(getContext())) {
- TargetReport targetReport = new TargetReport();
- targetReport.setName(attributes.getValue("name"));
- targetReport.setDepends(attributes.getValue("depends"));
- targetReport.setDescription(attributes.getValue("description"));
- targetReport.setIfCase(attributes.getValue("if"));
- targetReport.setUnlessCase(attributes.getValue("unless"));
- targetReport.setPhase(attributes.getValue("phase"));
- eaReport.addTargetReport(targetReport);
-
- Message.debug("Ant file has a target called : "
- + targetReport.getName());
- } else if ("ea:parameter".equals(name)) {
- if (attributes.getValue("property") != null) {
- propertyDescriptor = new PropertyDescriptor(
- attributes.getValue("property"));
- propertyDescriptor.setDefaultValue(attributes
- .getValue("default"));
- if (attributes.getValue("required") == null)
- propertyDescriptor.setRequired(false);
- else
- propertyDescriptor.setRequired(new Boolean(attributes
- .getValue("required")));
- if (attributes.getValue("description") != null) {
- propertyDescriptor.setDescription(attributes
- .getValue("description"));
- }
- } else if (attributes.getValue("phase") != null) {
- ParameterReport parameterReport = new ParameterReport(
- ParameterType.PHASE);
- parameterReport.setName(attributes.getValue("phase"));
- eaReport.addParameterReport(parameterReport);
- Message.debug("Ant file has a phase called : "
- + parameterReport.getName());
- } else if (attributes.getValue("path") != null) {
- ParameterReport parameterReport = new ParameterReport(
- ParameterType.PATH);
- parameterReport.setName(attributes.getValue("path"));
- parameterReport.setDefaultValue(attributes.getValue("default"));
- parameterReport.setRequired(new Boolean(attributes
- .getValue("required")));
- eaReport.addParameterReport(parameterReport);
- Message.debug("Ant file has a path called : "
- + parameterReport.getName());
- }
-
- } else if ("project/phase".equals(getContext())) {
- PhaseReport phaseReport = new PhaseReport(attributes
- .getValue("name"));
- phaseReport.setDepends(attributes.getValue("depends"));
- phaseReport.setDescription(attributes.getValue("description"));
- eaReport.addPhaseReport(phaseReport);
- Message.debug("Ant file has a phase called : "
- + phaseReport.getName());
- } else if ("project/ea:include".equals(getContext())) {
- ImportedModuleReport importedModuleReport = new ImportedModuleReport();
- importedModuleReport.setModuleMrid(attributes.getValue("mrid"));
- importedModuleReport.setModule(attributes.getValue("module"));
-
- String org = attributes.getValue("org") != null ? attributes
- .getValue("org") : attributes.getValue("organisation");
- importedModuleReport.setOrganisation(org);
-
- String rev = attributes.getValue("rev") != null ? attributes
- .getValue("rev") : attributes.getValue("revision");
- importedModuleReport.setRevision(rev);
-
- importedModuleReport.setType("include");
- importedModuleReport.setAs(attributes.getValue("as"));
- if (attributes.getValue("mandatory") != null) {
- importedModuleReport.setMandatory(Boolean
- .parseBoolean(attributes.getValue("mandatory")));
- }
-
- importedModuleReport.setEasyantReport(EasyAntReportModuleParser
- .parseEasyAntModule(importedModuleReport.getModuleMrid(),
- configuration));
- ;
- eaReport.addImportedModuleReport(importedModuleReport);
- Message.debug("Ant file import another module called : "
- + importedModuleReport.getModuleMrid() + " with mode "
- + importedModuleReport.getType());
- } else if ("project/ea:import".equals(getContext())) {
- ImportedModuleReport importedModuleReport = new ImportedModuleReport();
- importedModuleReport.setModuleMrid(attributes.getValue("mrid"));
- importedModuleReport.setModule(attributes.getValue("module"));
-
- String org = attributes.getValue("org") != null ? attributes
- .getValue("org") : attributes.getValue("organisation");
- importedModuleReport.setOrganisation(org);
-
- String rev = attributes.getValue("rev") != null ? attributes
- .getValue("rev") : attributes.getValue("revision");
- importedModuleReport.setRevision(rev);
-
- importedModuleReport.setType("import");
- importedModuleReport.setAs(attributes.getValue("as"));
- if (attributes.getValue("mandatory") != null) {
- importedModuleReport.setMandatory(Boolean
- .parseBoolean(attributes.getValue("mandatory")));
- }
-
- importedModuleReport.setEasyantReport(EasyAntReportModuleParser
- .parseEasyAntModule(importedModuleReport.getModuleMrid(),
- configuration));
- eaReport.addImportedModuleReport(importedModuleReport);
- Message.debug("Ant file import another module called : "
- + importedModuleReport.getModuleMrid() + " with mode "
- + importedModuleReport.getType());
- } else if ("project/property".equals(getContext())
- && properties.size() > 0) {
- if (attributes.getValue("file") != null) {
- Properties propToLoad = new Properties();
- File f = new File(
- replaceProperties(attributes.getValue("file")));
- try {
- propToLoad.load(new FileInputStream(f));
- for (Iterator iterator = propToLoad.keySet().iterator(); iterator
- .hasNext();) {
- String key = (String) iterator.next();
- PropertyDescriptor propertyDescriptor = new PropertyDescriptor(
- key);
- propertyDescriptor
- .setValue(propToLoad.getProperty(key));
- eaReport.addPropertyDescriptor(propertyDescriptor
- .getName(), propertyDescriptor);
- }
-
- } catch (Exception e) {
- throw new SAXException(
- "Unable to parse the property file :"
- + attributes.getValue("file"), e);
- }
- }
- }
- }
-
-
-
- @Override
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
-
- if ("ea:parameter".equals(qName)) {
- //handle nested description on properties
- if (propertyDescriptor!=null) {
- if (getText()!=null && getText().length() > 0) {
- propertyDescriptor.setDescription(getText());
- }
- Message.debug("Ant file has a property called : "
- + propertyDescriptor.getName());
- eaReport.addPropertyDescriptor(propertyDescriptor.getName(),
- propertyDescriptor);
- }
- }
- super.endElement(uri, localName, qName);
- //reset the propertyDescriptor
- propertyDescriptor=null;
- }
-
- protected String replaceProperties(String property) {
- return IvyPatternHelper.substituteVariables(property, properties);
- }
-
- public static final EasyAntReport parseEasyAntModule(String mrid,
- String conf) throws SAXException {
- ModuleRevisionId moduleRevisionId = null;
- try {
- moduleRevisionId = ModuleRevisionId.parse(mrid);
- } catch (IllegalArgumentException e) {
- Message.debug("Imposible to fetch data from " + mrid);
- Message.debug(e.getMessage());
- return null;
- }
- return parseEasyAntModule(moduleRevisionId, conf);
- }
-
- public static final EasyAntReport parseEasyAntModule(ModuleRevisionId mrid,
- String conf) throws SAXException {
- try {
- ResolveOptions resolveOptions = new ResolveOptions();
- resolveOptions.setLog(ResolveOptions.LOG_QUIET);
- resolveOptions.setConfs(conf.split(","));
- ResolveReport report = IvyContext.getContext().getIvy()
- .getResolveEngine().resolve(mrid, resolveOptions, true);
- // Try to parse easyAnt infos in ant files
- EasyAntReport easyAntReport = null;
-
- EasyAntReportModuleParser parser = new EasyAntReportModuleParser(
- conf);
-
- File antFile = null;
-
- for (int j = 0; j < report.getConfigurationReport(conf)
- .getAllArtifactsReports().length; j++) {
- ArtifactDownloadReport artifact = report
- .getConfigurationReport(conf).getAllArtifactsReports()[j];
-
- if ("ant".equals(artifact.getType())
- && "ant".equals(artifact.getExt())) {
- antFile = artifact.getLocalFile();
- } else {
- StringBuilder sb = new StringBuilder();
- sb.append(mrid.getOrganisation());
- sb.append("#");
- sb.append(mrid.getName());
- sb.append(".");
- if (!mrid.getName().equals(artifact.getName())) {
- sb.append(artifact.getName());
- sb.append(".");
- }
- sb.append(artifact.getExt());
- sb.append(".file");
- parser.properties.put(sb.toString(), artifact
- .getLocalFile().getAbsolutePath());
- }
- }
-
- if (antFile != null) {
-
- XMLHelper.parse(antFile.toURI().toURL(), null, parser, null);
- easyAntReport = parser.getEaReport();
- easyAntReport.setResolveReport(report);
- return easyAntReport;
- }
-
- } catch (ParseException e) {
- Message.debug("Imposible to fetch data from " + mrid.toString());
- Message.debug(e.getMessage());
- } catch (IOException e) {
- Message.debug("Imposible to fetch data from " + mrid.toString());
- Message.debug(e.getMessage());
- } catch (ParserConfigurationException e) {
- Message.debug("Imposible to fetch data from " + mrid.toString());
- Message.debug(e.getMessage());
- }
- return null;
- }
+ public EasyAntReportModuleParser(String configuration) {
+ super();
+ this.configuration = configuration;
+ }
+
+ public EasyAntReport getEaReport() {
+ return eaReport;
+ }
+
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public void startDocument() throws SAXException {
+ super.startDocument();
+ eaReport = new EasyAntReport();
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String name,
+ Attributes attributes) throws SAXException {
+ super.startElement(uri, localName, name, attributes);
+
+ if ("project/target".equals(getContext())) {
+ TargetReport targetReport = new TargetReport();
+ targetReport.setName(attributes.getValue("name"));
+ targetReport.setDepends(attributes.getValue("depends"));
+ targetReport.setDescription(attributes.getValue("description"));
+ targetReport.setIfCase(attributes.getValue("if"));
+ targetReport.setUnlessCase(attributes.getValue("unless"));
+ targetReport.setPhase(attributes.getValue("phase"));
+ eaReport.addTargetReport(targetReport);
+
+ Message.debug("Ant file has a target called : "
+ + targetReport.getName());
+ } else if ("ea:parameter".equals(name)) {
+ if (attributes.getValue("property") != null) {
+ propertyDescriptor = new PropertyDescriptor(
+ attributes.getValue("property"));
+ propertyDescriptor.setDefaultValue(attributes
+ .getValue("default"));
+ if (attributes.getValue("required") == null)
+ propertyDescriptor.setRequired(false);
+ else
+ propertyDescriptor.setRequired(new Boolean(attributes
+ .getValue("required")));
+ if (attributes.getValue("description") != null) {
+ propertyDescriptor.setDescription(attributes
+ .getValue("description"));
+ }
+ } else if (attributes.getValue("phase") != null) {
+ ParameterReport parameterReport = new ParameterReport(
+ ParameterType.PHASE);
+ parameterReport.setName(attributes.getValue("phase"));
+ eaReport.addParameterReport(parameterReport);
+ Message.debug("Ant file has a phase called : "
+ + parameterReport.getName());
+ } else if (attributes.getValue("path") != null) {
+ ParameterReport parameterReport = new ParameterReport(
+ ParameterType.PATH);
+ parameterReport.setName(attributes.getValue("path"));
+ parameterReport.setDefaultValue(attributes.getValue("default"));
+ parameterReport.setRequired(new Boolean(attributes
+ .getValue("required")));
+ eaReport.addParameterReport(parameterReport);
+ Message.debug("Ant file has a path called : "
+ + parameterReport.getName());
+ }
+
+ } else if ("project/phase".equals(getContext())) {
+ PhaseReport phaseReport = new PhaseReport(attributes
+ .getValue("name"));
+ phaseReport.setDepends(attributes.getValue("depends"));
+ phaseReport.setDescription(attributes.getValue("description"));
+ eaReport.addPhaseReport(phaseReport);
+ Message.debug("Ant file has a phase called : "
+ + phaseReport.getName());
+ } else if ("project/ea:include".equals(getContext())) {
+ ImportedModuleReport importedModuleReport = new ImportedModuleReport();
+ importedModuleReport.setModuleMrid(attributes.getValue("mrid"));
+ importedModuleReport.setModule(attributes.getValue("module"));
+
+ String org = attributes.getValue("org") != null ? attributes
+ .getValue("org") : attributes.getValue("organisation");
+ importedModuleReport.setOrganisation(org);
+
+ String rev = attributes.getValue("rev") != null ? attributes
+ .getValue("rev") : attributes.getValue("revision");
+ importedModuleReport.setRevision(rev);
+
+ importedModuleReport.setType("include");
+ importedModuleReport.setAs(attributes.getValue("as"));
+ if (attributes.getValue("mandatory") != null) {
+ importedModuleReport.setMandatory(Boolean
+ .parseBoolean(attributes.getValue("mandatory")));
+ }
+
+ importedModuleReport.setEasyantReport(EasyAntReportModuleParser
+ .parseEasyAntModule(importedModuleReport.getModuleMrid(),
+ configuration));
+ ;
+ eaReport.addImportedModuleReport(importedModuleReport);
+ Message.debug("Ant file import another module called : "
+ + importedModuleReport.getModuleMrid() + " with mode "
+ + importedModuleReport.getType());
+ } else if ("project/ea:import".equals(getContext())) {
+ ImportedModuleReport importedModuleReport = new ImportedModuleReport();
+ importedModuleReport.setModuleMrid(attributes.getValue("mrid"));
+ importedModuleReport.setModule(attributes.getValue("module"));
+
+ String org = attributes.getValue("org") != null ? attributes
+ .getValue("org") : attributes.getValue("organisation");
+ importedModuleReport.setOrganisation(org);
+
+ String rev = attributes.getValue("rev") != null ? attributes
+ .getValue("rev") : attributes.getValue("revision");
+ importedModuleReport.setRevision(rev);
+
+ importedModuleReport.setType("import");
+ importedModuleReport.setAs(attributes.getValue("as"));
+ if (attributes.getValue("mandatory") != null) {
+ importedModuleReport.setMandatory(Boolean
+ .parseBoolean(attributes.getValue("mandatory")));
+ }
+
+ importedModuleReport.setEasyantReport(EasyAntReportModuleParser
+ .parseEasyAntModule(importedModuleReport.getModuleMrid(),
+ configuration));
+ eaReport.addImportedModuleReport(importedModuleReport);
+ Message.debug("Ant file import another module called : "
+ + importedModuleReport.getModuleMrid() + " with mode "
+ + importedModuleReport.getType());
+ } else if ("project/property".equals(getContext())
+ && properties.size() > 0) {
+ if (attributes.getValue("file") != null) {
+ Properties propToLoad = new Properties();
+ File f = new File(
+ replaceProperties(attributes.getValue("file")));
+ try {
+ propToLoad.load(new FileInputStream(f));
+ for (Iterator iterator = propToLoad.keySet().iterator(); iterator
+ .hasNext();) {
+ String key = (String) iterator.next();
+ PropertyDescriptor propertyDescriptor = new PropertyDescriptor(
+ key);
+ propertyDescriptor
+ .setValue(propToLoad.getProperty(key));
+ eaReport.addPropertyDescriptor(propertyDescriptor
+ .getName(), propertyDescriptor);
+ }
+
+ } catch (Exception e) {
+ throw new SAXException(
+ "Unable to parse the property file :"
+ + attributes.getValue("file"), e);
+ }
+ }
+ }
+ }
+
+
+
+ @Override
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ if ("ea:parameter".equals(qName)) {
+ //handle nested description on properties
+ if (propertyDescriptor!=null) {
+ if (getText()!=null && getText().length() > 0) {
+ propertyDescriptor.setDescription(getText());
+ }
+ Message.debug("Ant file has a property called : "
+ + propertyDescriptor.getName());
+ eaReport.addPropertyDescriptor(propertyDescriptor.getName(),
+ propertyDescriptor);
+ }
+ }
+ super.endElement(uri, localName, qName);
+ //reset the propertyDescriptor
+ propertyDescriptor=null;
+ }
+
+ protected String replaceProperties(String property) {
+ return IvyPatternHelper.substituteVariables(property, properties);
+ }
+
+ public static final EasyAntReport parseEasyAntModule(String mrid,
+ String conf) throws SAXException {
+ ModuleRevisionId moduleRevisionId = null;
+ try {
+ moduleRevisionId = ModuleRevisionId.parse(mrid);
+ } catch (IllegalArgumentException e) {
+ Message.debug("Imposible to fetch data from " + mrid);
+ Message.debug(e.getMessage());
+ return null;
+ }
+ return parseEasyAntModule(moduleRevisionId, conf);
+ }
+
+ public static final EasyAntReport parseEasyAntModule(ModuleRevisionId mrid,
+ String conf) throws SAXException {
+ try {
+ ResolveOptions resolveOptions = new ResolveOptions();
+ resolveOptions.setLog(ResolveOptions.LOG_QUIET);
+ resolveOptions.setConfs(conf.split(","));
+ ResolveReport report = IvyContext.getContext().getIvy()
+ .getResolveEngine().resolve(mrid, resolveOptions, true);
+ // Try to parse easyAnt infos in ant files
+ EasyAntReport easyAntReport = null;
+
+ EasyAntReportModuleParser parser = new EasyAntReportModuleParser(
+ conf);
+
+ File antFile = null;
+
+ for (int j = 0; j < report.getConfigurationReport(conf)
+ .getAllArtifactsReports().length; j++) {
+ ArtifactDownloadReport artifact = report
+ .getConfigurationReport(conf).getAllArtifactsReports()[j];
+
+ if ("ant".equals(artifact.getType())
+ && "ant".equals(artifact.getExt())) {
+ antFile = artifact.getLocalFile();
+ } else {
+ StringBuilder sb = new StringBuilder();
+ sb.append(mrid.getOrganisation());
+ sb.append("#");
+ sb.append(mrid.getName());
+ sb.append(".");
+ if (!mrid.getName().equals(artifact.getName())) {
+ sb.append(artifact.getName());
+ sb.append(".");
+ }
+ sb.append(artifact.getExt());
+ sb.append(".file");
+ parser.properties.put(sb.toString(), artifact
+ .getLocalFile().getAbsolutePath());
+ }
+ }
+
+ if (antFile != null) {
+
+ XMLHelper.parse(antFile.toURI().toURL(), null, parser, null);
+ easyAntReport = parser.getEaReport();
+ easyAntReport.setResolveReport(report);
+ return easyAntReport;
+ }
+
+ } catch (ParseException e) {
+ Message.debug("Imposible to fetch data from " + mrid.toString());
+ Message.debug(e.getMessage());
+ } catch (IOException e) {
+ Message.debug("Imposible to fetch data from " + mrid.toString());
+ Message.debug(e.getMessage());
+ } catch (ParserConfigurationException e) {
+ Message.debug("Imposible to fetch data from " + mrid.toString());
+ Message.debug(e.getMessage());
+ }
+ return null;
+ }
}
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ImportedModuleReport.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ImportedModuleReport.java?rev=1073371&r1=1073370&r2=1073371&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ImportedModuleReport.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ImportedModuleReport.java Tue Feb 22 15:55:55 2011
@@ -20,79 +20,79 @@ package org.apache.easyant.core.report;
import org.apache.ivy.core.module.id.ModuleRevisionId;
public class ImportedModuleReport {
- String module = null;
- String organisation = null;
- String revision = null;
- String moduleMrid = null;
- String type = null;
- String as = null;
- boolean mandatory = false;
-
- EasyAntReport easyantReport = null;
-
- public String getModule() {
- return module;
- }
-
- public void setModule(String module) {
- this.module = module;
- }
-
- public String getOrganisation() {
- return organisation;
- }
-
- public void setOrganisation(String organisation) {
- this.organisation = organisation;
- }
-
- public String getRevision() {
- return revision;
- }
-
- public void setRevision(String revision) {
- this.revision = revision;
- }
-
- public String getModuleMrid() {
- return moduleMrid != null ? moduleMrid : ModuleRevisionId.newInstance(
- organisation, module, revision).toString();
- }
-
- public void setModuleMrid(String moduleMrid) {
- this.moduleMrid = moduleMrid;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getAs() {
- return as;
- }
-
- public void setAs(String as) {
- this.as = as;
- }
-
- public EasyAntReport getEasyantReport() {
- return easyantReport;
- }
-
- public void setEasyantReport(EasyAntReport easyantReport) {
- this.easyantReport = easyantReport;
- }
-
- public boolean isMandatory() {
- return mandatory;
- }
-
- public void setMandatory(boolean mandatory) {
- this.mandatory = mandatory;
- }
+ String module = null;
+ String organisation = null;
+ String revision = null;
+ String moduleMrid = null;
+ String type = null;
+ String as = null;
+ boolean mandatory = false;
+
+ EasyAntReport easyantReport = null;
+
+ public String getModule() {
+ return module;
+ }
+
+ public void setModule(String module) {
+ this.module = module;
+ }
+
+ public String getOrganisation() {
+ return organisation;
+ }
+
+ public void setOrganisation(String organisation) {
+ this.organisation = organisation;
+ }
+
+ public String getRevision() {
+ return revision;
+ }
+
+ public void setRevision(String revision) {
+ this.revision = revision;
+ }
+
+ public String getModuleMrid() {
+ return moduleMrid != null ? moduleMrid : ModuleRevisionId.newInstance(
+ organisation, module, revision).toString();
+ }
+
+ public void setModuleMrid(String moduleMrid) {
+ this.moduleMrid = moduleMrid;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getAs() {
+ return as;
+ }
+
+ public void setAs(String as) {
+ this.as = as;
+ }
+
+ public EasyAntReport getEasyantReport() {
+ return easyantReport;
+ }
+
+ public void setEasyantReport(EasyAntReport easyantReport) {
+ this.easyantReport = easyantReport;
+ }
+
+ public boolean isMandatory() {
+ return mandatory;
+ }
+
+ public void setMandatory(boolean mandatory) {
+ this.mandatory = mandatory;
+ }
}
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterReport.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterReport.java?rev=1073371&r1=1073370&r2=1073371&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterReport.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterReport.java Tue Feb 22 15:55:55 2011
@@ -18,60 +18,60 @@
package org.apache.easyant.core.report;
public class ParameterReport {
-
- private String name = null;
- private String description = null;
- private boolean required = false;
- private String defaultValue = null;
- private String value = null;
- private final ParameterType type;
-
- public ParameterReport(ParameterType parameterType) {
- this.type = parameterType;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public boolean isRequired() {
- return required;
- }
-
- public void setRequired(boolean required) {
- this.required = required;
- }
-
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public ParameterType getType() {
- return type;
- }
+
+ private String name = null;
+ private String description = null;
+ private boolean required = false;
+ private String defaultValue = null;
+ private String value = null;
+ private final ParameterType type;
+
+ public ParameterReport(ParameterType parameterType) {
+ this.type = parameterType;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public ParameterType getType() {
+ return type;
+ }
}
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterType.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterType.java?rev=1073371&r1=1073370&r2=1073371&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterType.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterType.java Tue Feb 22 15:55:55 2011
@@ -18,9 +18,9 @@
package org.apache.easyant.core.report;
public enum ParameterType {
-
- PROPERTY,
- PATH,
- PHASE
+
+ PROPERTY,
+ PATH,
+ PHASE
}
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/PhaseReport.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/PhaseReport.java?rev=1073371&r1=1073370&r2=1073371&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/PhaseReport.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/PhaseReport.java Tue Feb 22 15:55:55 2011
@@ -22,71 +22,71 @@ import java.util.Collections;
import java.util.List;
public class PhaseReport {
- private final String name;
- private String description;
- private String depends;
-
- private List<TargetReport> targetReports;
-
- public PhaseReport(String name) {
- super();
- this.name = name;
- targetReports = new ArrayList<TargetReport>();
- }
-
- public String getName() {
- return name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getDepends() {
- return depends;
- }
-
- public void setDepends(String depends) {
- this.depends = depends;
- }
-
- public List<TargetReport> getTargetReports() {
- return Collections.unmodifiableList(targetReports);
- }
-
- public void addTargetReport(TargetReport targetReport) {
- if (targetReport == null)
- throw new IllegalArgumentException("targetReport cannot be null");
- targetReports.add(targetReport);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PhaseReport other = (PhaseReport) obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- return true;
- }
+ private final String name;
+ private String description;
+ private String depends;
+
+ private List<TargetReport> targetReports;
+
+ public PhaseReport(String name) {
+ super();
+ this.name = name;
+ targetReports = new ArrayList<TargetReport>();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getDepends() {
+ return depends;
+ }
+
+ public void setDepends(String depends) {
+ this.depends = depends;
+ }
+
+ public List<TargetReport> getTargetReports() {
+ return Collections.unmodifiableList(targetReports);
+ }
+
+ public void addTargetReport(TargetReport targetReport) {
+ if (targetReport == null)
+ throw new IllegalArgumentException("targetReport cannot be null");
+ targetReports.add(targetReport);
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PhaseReport other = (PhaseReport) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
}
Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/TargetReport.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/TargetReport.java?rev=1073371&r1=1073370&r2=1073371&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/TargetReport.java (original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/TargetReport.java Tue Feb 22 15:55:55 2011
@@ -18,59 +18,59 @@
package org.apache.easyant.core.report;
public class TargetReport {
- private String name = null;
- private String depends = null;
- private String ifCase = null;
- private String unlessCase = null;
- private String description = null;
- private String phase = null;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getDepends() {
- return depends;
- }
-
- public void setDepends(String depends) {
- this.depends = depends;
- }
-
- public String getIfCase() {
- return ifCase;
- }
-
- public void setIfCase(String ifCase) {
- this.ifCase = ifCase;
- }
-
- public String getUnlessCase() {
- return unlessCase;
- }
-
- public void setUnlessCase(String unlessCase) {
- this.unlessCase = unlessCase;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getPhase() {
- return phase;
- }
-
- public void setPhase(String phase) {
- this.phase = phase;
- }
+ private String name = null;
+ private String depends = null;
+ private String ifCase = null;
+ private String unlessCase = null;
+ private String description = null;
+ private String phase = null;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDepends() {
+ return depends;
+ }
+
+ public void setDepends(String depends) {
+ this.depends = depends;
+ }
+
+ public String getIfCase() {
+ return ifCase;
+ }
+
+ public void setIfCase(String ifCase) {
+ this.ifCase = ifCase;
+ }
+
+ public String getUnlessCase() {
+ return unlessCase;
+ }
+
+ public void setUnlessCase(String unlessCase) {
+ this.unlessCase = unlessCase;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getPhase() {
+ return phase;
+ }
+
+ public void setPhase(String phase) {
+ this.phase = phase;
+ }
}