Package org.apache.tools.ant

Examples of org.apache.tools.ant.PropertyHelper


        public String evalName(Project p) {
            return valid(p) ? name : null;
        }

        private boolean valid(Project p) {
            PropertyHelper ph = PropertyHelper.getPropertyHelper(p);
            return ph.testIfCondition(ifCond)
                && ph.testUnlessCondition(unlessCond);
        }
View Full Code Here


     * @param n name of property
     * @param v value to set
     * @since Ant 1.8
     */
    protected void addProperty(String n, Object v) {
        PropertyHelper ph = PropertyHelper.getPropertyHelper(getProject());
        if (userProperty) {
            if (ph.getUserProperty(n) == null) {
                ph.setInheritedProperty(n, v);
            } else {
                log("Override ignored for " + n, Project.MSG_VERBOSE);
            }
        } else {
            ph.setNewProperty(n, v);
        }
    }
View Full Code Here

    /**
     * resolve properties inside a properties hashtable
     * @param props properties object to resolve
     */
    private void resolveAllProperties(Map props) throws BuildException {
        PropertyHelper propertyHelper
            = (PropertyHelper) PropertyHelper.getPropertyHelper(getProject());
        new ResolvePropertyMap(
                               getProject(),
                               propertyHelper,
                               propertyHelper.getExpanders()).resolveAllProperties(props);
    }
View Full Code Here

            {
                ExpressionEvaluator exprEvaluator =
                    new PluginParameterExpressionEvaluator( session, mojoExecution, pathTranslator, logger, mavenProject,
                                                            mavenProject.getProperties() );
               
                PropertyHelper propertyHelper = PropertyHelper.getPropertyHelper( antProject );
                propertyHelper.setNext( new AntPropertyHelper( exprEvaluator, mavenProject.getArtifacts(), getLog() ) );
            }
            else
            {
                unconstructedParts.add( "Maven parameter expression evaluator for Ant properties." );
            }
View Full Code Here

     * Refresh the known properties.
     * </p>
     */
    private void  refreshProperties()
    {
        PropertyHelper  helper = PropertyHelper.getPropertyHelper( getProject() );
       
        _propertiesSnapshot = helper.getProperties();

        // Set the verbose debugging flag, it is used by static methods.
        VERBOSE_DEBUG_ENABLED = Boolean.valueOf((String)
                    _propertiesSnapshot.get(PROPERTY_SETTER_VERBOSE_DEBUG_FLAG)
                ).booleanValue();
View Full Code Here

     * Refresh the known properties.
     * </p>
     */
    private void  refreshProperties()
    {
        PropertyHelper  helper = PropertyHelper.getPropertyHelper( getProject() );
       
        _propertiesSnapshot = helper.getProperties();

        // Set the verbose debugging flag, it is used by static methods.
        VERBOSE_DEBUG_ENABLED = Boolean.valueOf((String)
                    _propertiesSnapshot.get(PROPERTY_SETTER_VERBOSE_DEBUG_FLAG)
                ).booleanValue();
View Full Code Here

        // Add a reference to this task/type
        antProject.addReference( antId, this );

        // Register the property intercepter or delegate
        PropertyHelper phelper = PropertyHelper.getPropertyHelper( antProject );
        try
        {
            // Ant 1.8.0 delegate
            POMPropertyEvaluator.register( this, phelper );
        }
        catch ( LinkageError e )
        {
            // fallback to 1.6 - 1.7.1 intercepter chaining
            helper.setNext( phelper.getNext() );
            helper.setProject( antProject );
            phelper.setNext( helper );
        }
    }
View Full Code Here

  public void execute() throws BuildException {
    try {
      // Generate a unique IU
      String id = UUID.randomUUID().toString();
      // Set or update the property value
      PropertyHelper helper = (PropertyHelper) getProject().getReference("ant.PropertyHelper");
      helper.setProperty(null, this.propertyname, id, true);
      log("Generated ID [" + id + "] put in property [" + this.propertyname + "].");
    } catch (Exception e) {
      throw new BuildException(e);
    }
  }
View Full Code Here

  @Override
  public void execute() throws BuildException {
    try {
      String v = (this.newvalue == null) ? "" : this.newvalue;
      // Set or update the property value
      PropertyHelper helper = (PropertyHelper) getProject().getReference("ant.PropertyHelper");
      helper.setProperty(null, this.propertyname, v, true);
    } catch (Exception e) {
      throw new BuildException(e);
    }
  }
View Full Code Here

        // Add a reference to this task/type
        project.addReference( antId, this );

        // Register the property interceptor
        PropertyHelper phelper = PropertyHelper.getPropertyHelper( project );
        helper.setNext( phelper.getNext() );
        helper.setProject( project );
        phelper.setNext( helper );
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.PropertyHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.