Package org.apache.tools.ant

Examples of org.apache.tools.ant.PropertyHelper


    private void createReport(final String database, final String format, final String title,
                              final String output, final String historyOut, final boolean summary) {
        final Project antProject = new Project();
        antProject.init();

        PropertyHelper propertyHelper = PropertyHelper.getPropertyHelper( antProject );

        propertyHelper.setNext( new AntPropertyHelper( project, getLog() ) );

        antProject.setUserProperty("ant.file", reportDescriptor.getAbsolutePath());
        antProject.setCoreLoader(getClass().getClassLoader());

        addMavenProperties(antProject);
View Full Code Here


    }


    public void execute() {
        PropertyHelper phelper=PropertyHelper.getPropertyHelper( project );
        helper.setProject( project );
        helper.setNext( phelper.getNext() );
        phelper.setNext( helper );

        project.addReference( "jndiProperties", this );
    }
View Full Code Here

         * Ensures that the param passes the conditions placed
         * on it with <code>if</code> and <code>unless</code> properties.
         * @return true if the task passes the "if" and "unless" parameters
         */
        public boolean shouldUse() {
            PropertyHelper ph = PropertyHelper.getPropertyHelper(project);
            return ph.testIfCondition(ifCond)
                && ph.testUnlessCondition(unlessCond);
        }
View Full Code Here

        }

        isTask = true;
        try {
            if (eval()) {
                PropertyHelper ph = PropertyHelper.getPropertyHelper(getProject());
                Object oldvalue = ph.getProperty(property);
                if (null != oldvalue && !oldvalue.equals(value)) {
                    log("DEPRECATED - <available> used to override an existing"
                        + " property."
                        + StringUtils.LINE_SEP
                        + "  Build file should not reuse the same property"
                        + " name for different values.",
                        Project.MSG_WARN);
                }
                // NB: this makes use of Project#setProperty rather than Project#setNewProperty
                //     due to backwards compatiblity reasons
                ph.setProperty(property, value, true);
            }
        } finally {
            isTask = false;
        }
    }
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, getPrefix(), getPrefixValues());
    }
View Full Code Here

        }
        if (propertyHelper == null && delegates == null) {
            throw new BuildException("Either a new PropertyHelper"
                    + " or one or more PropertyHelper delegates are required");
        }
        PropertyHelper ph = propertyHelper;
        if (ph == null) {
            ph = PropertyHelper.getPropertyHelper(getProject());
        } else {
            ph = propertyHelper;
        }
        synchronized (ph) {
            if (delegates != null) {
                for (Iterator iter = delegates.iterator(); iter.hasNext();) {
                    Object o = iter.next();
                    PropertyHelper.Delegate delegate = o instanceof DelegateElement
                            ? ((DelegateElement) o).resolve() : (PropertyHelper.Delegate) o;
                    log("Adding PropertyHelper delegate " + delegate, Project.MSG_DEBUG);
                    ph.add(delegate);
                }
            }
        }
        if (propertyHelper != null) {
            log("Installing PropertyHelper " + propertyHelper, Project.MSG_DEBUG);
View Full Code Here

            FileUtils.close(bis);
        }
    }

    private Resource parse(final String line) {
        PropertyHelper propertyHelper
            = (PropertyHelper) PropertyHelper.getPropertyHelper(getProject());
        Object expanded = propertyHelper.parseProperties(line);
        if (expanded instanceof Resource) {
            return (Resource) expanded;
        }
        String expandedLine = expanded.toString();
        int colon = expandedLine.indexOf(":");
View Full Code Here

        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

         * Ensures that the param passes the conditions placed
         * on it with <code>if</code> and <code>unless</code> properties.
         * @return true if the task passes the "if" and "unless" parameters
         */
        public boolean shouldUse() {
            PropertyHelper ph = PropertyHelper.getPropertyHelper(project);
            return ph.testIfCondition(ifCond)
                && ph.testUnlessCondition(unlessCond);
        }
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.