Examples of UnknownElement


Examples of org.apache.tools.ant.UnknownElement

                "Unknown attribute" + (copyKeys.size() > 1 ? "s " : " ")
                + copyKeys);
        }

        // need to set the project on unknown element
        UnknownElement c = copy(macroDef.getNestedTask());
        c.init();
        try {
            c.perform();
        } catch (BuildException ex) {
            throw ProjectHelper.addLocationToBuildException(
                ex, getLocation());
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        for (int i = 0; i < tasks.size(); i++) {
            Task task = (Task) tasks.elementAt(i);
            if (!(task instanceof UnknownElement)) {
                continue;
            }
            UnknownElement ue = ((UnknownElement) task);
            StringBuffer descComp = ue.getWrapper().getText();
            if (descComp != null) {
                description.append((Object) descComp);
            }
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

                // swallow here, will be thrown again in
                // UnknownElement.maybeConfigure if the problem persists.
            }

            if (task == null) {
                task = new UnknownElement(tag);
                task.setProject(helperImpl.project);
                //XXX task.setTaskType(tag);
                task.setTaskName(tag);
            }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

                IntrospectionHelper.getHelper(parentClass);

            try {
                String elementName = propType.toLowerCase(Locale.US);
                if (parent instanceof UnknownElement) {
                    UnknownElement uc = new UnknownElement(elementName);
                    uc.setProject(helperImpl.project);
                    ((UnknownElement) parent).addChild(uc);
                    child = uc;
                } else {
                    child = ih.createElement(helperImpl.project, parent, elementName);
                }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

                parent = parentWrapper.getProxy();
            }

            /* UnknownElement is used for tasks and data types - with
               delayed eval */
            UnknownElement task = new UnknownElement(tag);
            task.setProject(context.getProject());
            task.setNamespace(uri);
            task.setQName(qname);
            task.setTaskType(
                ProjectHelper.genComponentName(task.getNamespace(), tag));
            task.setTaskName(qname);

            Location location = new Location(context.getLocator().getSystemId(),
                    context.getLocator().getLineNumber(),
                    context.getLocator().getColumnNumber());
            task.setLocation(location);
            task.setOwningTarget(context.getCurrentTarget());

            context.configureId(task, attrs);

            if (parent != null) {
                // Nested element
                ((UnknownElement) parent).addChild(task);
            else {
                // Task included in a target ( including the default one ).
                context.getCurrentTarget().addTask(task);
            }

            // container.addTask(task);
            // This is a nop in UE: task.init();

            RuntimeConfigurable wrapper
                = new RuntimeConfigurable(task, task.getTaskName());

            for (int i = 0; i < attrs.getLength(); i++) {
                String attrUri = attrs.getURI(i);
                if (attrUri != null
                    && !attrUri.equals("")
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

    /**
     * Convert the nested sequential to an unknown element
     * @return the nested sequential as an unknown element.
     */
    public UnknownElement getNestedTask() {
        UnknownElement ret = new UnknownElement("sequential");
        ret.setTaskName("sequential");
        ret.setNamespace("");
        ret.setQName("sequential");
        new RuntimeConfigurable(ret, "sequential");
        for (int i = 0; i < nestedSequential.getNested().size(); ++i) {
            UnknownElement e =
                (UnknownElement) nestedSequential.getNested().get(i);
            ret.addChild(e);
            ret.getWrapper().addChild(e.getWrapper());
        }
        return ret;
    }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        public boolean similar(NestedSequential other) {
            if (nested.size() != other.nested.size()) {
                return false;
            }
            for (int i = 0; i < nested.size(); ++i) {
                UnknownElement me = (UnknownElement) nested.get(i);
                UnknownElement o = (UnknownElement) other.nested.get(i);
                if (!me.similar(o)) {
                    return false;
                }
            }
            return true;
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

     *
     * @param task The started Task.
     */
    protected void taskStartedInternal(Task task) {
        if (isActive()) {
            UnknownElement originalTask = null;
            if (task instanceof UnknownElement) {
                originalTask = (UnknownElement)task;
                try {
                    originalTask.maybeConfigure();
                    if (originalTask.getTask() != null) {
                        task = originalTask.getTask();
                    }
                } catch (Exception ex) {
                    Object obj = originalTask.getWrapper().getProxy();
                    if (obj instanceof Task && !(obj instanceof UnknownElement)) {
                        task = (Task)obj;
                    } else {
                        getLineBuffer().logLine(LogPriority.ERROR, getStackTrace(ex));
                    }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        Task nested = (Task)taskCtrl.getMock();
        nested.getTaskName();
        taskCtrl.setReturnValue("foo");

        MockControl ukeCtrl = MockClassControl.createControl(UnknownElement.class);
        UnknownElement mockUke = getMockUnknownElement(ukeCtrl,
                                                       nested,
                                                       new AssertionWarningException());

        taskCtrl.replay();
        ukeCtrl.replay();
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

       
        ServiceDef nested = new ServiceDef();
        nested.setName("myService");

        MockControl ukeCtrl = MockClassControl.createControl(UnknownElement.class);
        UnknownElement mockUke = getMockUnknownElement(ukeCtrl,
                                                       nested,
                                                       new AssertionWarningException());

        ukeCtrl.replay();
        group.addTask(mockUke);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.