Examples of XmlTag


Examples of com.dtrules.mapping.XMLTag

      static class NewXmlAttribute extends ROperator {
          NewXmlAttribute(){super("newxmlattribute"); }
          @Override
            public void execute(DTState state) throws RulesException {
                RName     name      = state.datapop().rNameValue();
                XMLTag    xmlNode   = new XMLTag(name.stringValue(),null);
                RXmlValue xmlValue  = new RXmlValue(state,xmlNode);
               
                state.datapush(xmlValue);
            }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

                PsiTreeUtil.processElements(goalTag, new PsiElementProcessor() {
                    public boolean execute(final PsiElement element) {
                        if (!(element instanceof XmlTag))
                            return true;

                        final XmlTag tag = (XmlTag) element;
                        if ("doc:registerReport".equals(tag.getName())) {
                            final DefaultReport report = new DefaultReport();
                            report.setPlugin(plugin);
                            report.setDescription(tag.getAttributeValue("description"));
                            report.setId(id);
                            report.setName(tag.getAttributeValue("name"));
                            reports.add(report);
                        }

                        return true;
                    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

        final XmlFile jellyPsi = PsiUtils.findXmlFile(project, jellyFile);
        final XmlTagPath goalsPath = new XmlTagPath(jellyPsi, "project/goal");
        final XmlTag[] goalTags = goalsPath.getAllTags();
        final PluginGoal[] goals = new PluginGoal[goalTags.length];
        for (int i = 0; i < goalTags.length; i++) {
            XmlTag tag = goalTags[i];
            final String name = tag.getAttributeValue("name");
            final String lcName = name.toLowerCase();
            if (lcName.equalsIgnoreCase("register") || lcName.equalsIgnoreCase("deregister"))
                continue;

            final String desc = tag.getAttributeValue("description");
            final String preReqsValue = tag.getAttributeValue("prereqs");
            final String[] preReqs = preReqsValue == null ? EMPTY_STRING_ARRAY : preReqsValue.split(
                    ",");

            final DefaultPluginGoal goal = new DefaultPluginGoal();
            goal.setName(name);
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

     */
    public String findPropertyForElement(final PsiElement pTextElt) {
        for (Map.Entry<String, XmlTagPath> entry : tags.entrySet()) {
            final String property = entry.getKey();
            final XmlTagPath path = entry.getValue();
            final XmlTag tag = path.getTag();
            if (PsiTreeUtil.isAncestor(tag, pTextElt, false))
                return property;
        }

        return null;
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

    public final void childRemoved(final PsiTreeChangeEvent pEvent) {
        if (ignoreEvents)
            return;

        final PsiElement child = pEvent.getChild();
        final XmlTag parent = PsiTreeUtil.getParentOfType(pEvent.getParent(),
                                                          XmlTag.class,
                                                          false);
        if (parent == null)
            return;

        if (child instanceof XmlText) {
            final String changedProperty = getPropertyForElement(parent);
            if (changedProperty != null)
                notifyChange(changedProperty);
        }
        else if (child instanceof XmlTag) {
            final XmlTag tag = (XmlTag) child;
            final String[] tagPath = PsiUtils.getPathAndConcat(parent, tag.getName());
            final String changedProperty = getPropertyForPath(tagPath);
            if (changedProperty != null)
                notifyRemoval(changedProperty);
        }
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

    public final void childReplaced(final PsiTreeChangeEvent pEvent) {
        if (ignoreEvents)
            return;

        final PsiElement oldChild = pEvent.getOldChild();
        final XmlTag parent = PsiTreeUtil.getParentOfType(pEvent.getParent(),
                                                          XmlTag.class,
                                                          false);
        if (parent == null)
            return;

        String oldChangedProperty = null;
        String newChangedProperty = null;

        if (oldChild instanceof XmlText)
            oldChangedProperty = getPropertyForElement(parent);
        else if (oldChild instanceof XmlTag) {
            final XmlTag tag = (XmlTag) oldChild;
            final String[] tagPath = PsiUtils.getPathAndConcat(parent, tag.getName());
            oldChangedProperty = getPropertyForPath(tagPath);
        }

        final PsiElement newChild = pEvent.getNewChild();
        if (newChild instanceof XmlText)
            newChangedProperty = getPropertyForElement(newChild);
        else if (newChild instanceof XmlTag) {
            final XmlTag tag = (XmlTag) newChild;
            final String[] tagPath = PsiUtils.getPathAndConcat(parent, tag.getName());
            newChangedProperty = getPropertyForPath(tagPath);
        }

        if (oldChangedProperty == null && newChangedProperty == null)
            return;
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

    private XmlTag getRootTag() {
        final XmlDocument xmlDocument = getXmlDocument();
        if (xmlDocument == null)
            return null;
        else {
            final XmlTag rootTag = xmlDocument.getRootTag();
            if (rootTag == null)
                return null;

            if (!rootTag.getName().equals(parseRootTagName()))
                return null;

            return rootTag;
        }
    }
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

     * @throws IncorrectOperationException if the root already exists, but does not satisfy the tag
     *                                     path expression
     */
    private XmlTag ensureRootTag() throws IncorrectOperationException {
        final XmlDocument xmlDocument = ensureXmlDocument();
        XmlTag rootTag = xmlDocument.getRootTag();
        if (rootTag != null) {
            final String rootTagName = rootTag.getName();
            if (!rootTagName.equals(parseRootTagName()))
                throw new IncorrectOperationException(
                        RES.get("incorrect.root.tag", rootTagName));
            else
                return rootTag;
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

     *
     * @return the xml tag, or {@code null}
     */
    public final XmlTag getTag() {
        final String[] pathTokens = getPathTokens();
        final XmlTag rootTag = getRootTag();
        if (rootTag == null)
            return null;

        //
        //The getRootTag method used above already makes sure that the root
        //tag name matches the tag name in the tag-path's first token, and
        //returns null if not, therefor we can safely start the iteration
        //at index 1 rather than 0 (where 0 is the root tag's expression).
        //
        XmlTag context = rootTag;
        for (int i = 1; i < pathTokens.length; i++) {
            final XmlFilterExpression expr =
                    XmlFilterExpression.create(pathTokens[i]);

            context = expr.findChildTag(context);
View Full Code Here

Examples of com.intellij.psi.xml.XmlTag

     *
     * @return an array of xml tags (never {@code null})
     */
    public final XmlTag[] getAllTags() {
        final String[] pathTokens = getPathTokens();
        final XmlTag rootTag = getRootTag();
        if (rootTag == null)
            return new XmlTag[0];

        //
        //The getRootTag method used above already makes sure that the root
        //tag name matches the tag name in the tag-path's first token, and
        //returns null if not, therefor we can safely start the iteration
        //at index 1 rather than 0 (where 0 is the root tag's expression).
        //
        XmlTag context = rootTag;
        for (int i = 1; i < pathTokens.length - 1; i++) {
            final XmlFilterExpression expr =
                    XmlFilterExpression.create(pathTokens[i]);

            context = expr.findChildTag(context);
            if (context == null)
                break;
        }

        if (context != null)
            return context.findSubTags(pathTokens[pathTokens.length - 1]);
        else
            return new XmlTag[0];
    }
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.