Package org.apache.tools.ant

Examples of org.apache.tools.ant.PropertyHelper


    {
        String sql = "";
        String line = "";

        BufferedReader in = new BufferedReader(reader);
        PropertyHelper ph = PropertyHelper.getPropertyHelper(getProject());

        try
        {
            while ((line = in.readLine()) != null)
            {
                line = line.trim();
                line = ph.replaceProperties("", line, getProject().getProperties());
                if (line.startsWith("//") || line.startsWith("--"))
                {
                    continue;
                }
                if (line.length() > 4
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

         * 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

     * @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, prefix);
    }
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 compatibility reasons
                ph.setProperty(property, value, true);
            }
        } finally {
            isTask = false;
        }
    }
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

        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 selector passes the conditions placed
     * on it with <code>if</code> and <code>unless</code>.
     * @return true if conditions are passed
     */
    public boolean passesConditions() {
        PropertyHelper ph = PropertyHelper.getPropertyHelper(getProject());
        return ph.testIfCondition(ifCondition)
            && ph.testUnlessCondition(unlessCondition);
    }
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

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.