private void validateFeatureAttributes(Element element) { if (fMonitor.isCanceled()) return; assertAttributeDefined(element, "id", CompilerFlags.ERROR); //$NON-NLS-1$ assertAttributeDefined(element, "version", CompilerFlags.ERROR); //$NON-NLS-1$ NamedNodeMap attributes = element.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { String name = attributes.item(i).getNodeName(); if (!attrs.contains(name)) { reportUnknownAttribute(element, name, CompilerFlags.ERROR); } else if (name.equals("id")){ //$NON-NLS-1$ validatePluginID(element, (Attr)attributes.item(i)); } else if (name.equals("primary") || name.equals("exclusive")){ //$NON-NLS-1$ //$NON-NLS-2$ validateBoolean(element, (Attr)attributes.item(i)); } else if (name.equals("version")) { //$NON-NLS-1$ validateVersionAttribute(element, (Attr)attributes.item(i)); } if (name.equals("primary")){ //$NON-NLS-1$ reportDeprecatedAttribute(element, (Attr)attributes.item(i)); } else if (name.equals("plugin")){ //$NON-NLS-1$ validatePluginID(element, (Attr)attributes.item(i), false); } } }
private void validateFeatureAttributes(Element element) { if (fMonitor.isCanceled()) return; assertAttributeDefined(element, "id", CompilerFlags.ERROR); //$NON-NLS-1$ assertAttributeDefined(element, "version", CompilerFlags.ERROR); //$NON-NLS-1$ NamedNodeMap attributes = element.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { String name = attributes.item(i).getNodeName(); if (!attrs.contains(name)) { reportUnknownAttribute(element, name, CompilerFlags.ERROR); } else if (name.equals("id")) { //$NON-NLS-1$ validateFeatureID(element, (Attr) attributes.item(i)); } else if (name.equals("primary") || name.equals("exclusive")) { //$NON-NLS-1$ //$NON-NLS-2$ validateBoolean(element, (Attr) attributes.item(i)); } else if (name.equals("version")) { //$NON-NLS-1$ validateVersionAttribute(element, (Attr) attributes.item(i)); } if (name.equals("primary")) { //$NON-NLS-1$ reportDeprecatedAttribute(element, (Attr) attributes.item(i)); } else if (name.equals("plugin")) { //$NON-NLS-1$ validatePluginExists(element, (Attr) attributes.item(i), false); } } }
validateVersionAttribute(include, attr); } else if (name.equals("optional")) { //$NON-NLS-1$ validateBoolean(include, attr); } else if (name.equals("search-location")) { //$NON-NLS-1$ String value = include.getAttribute("search-location"); //$NON-NLS-1$
validateVersionAttribute(include, attr); } else if (name.equals("optional")) { //$NON-NLS-1$ validateBoolean(include, attr); } else if (name.equals("search-location")) { //$NON-NLS-1$ String value = include.getAttribute("search-location"); //$NON-NLS-1$
validateVersionAttribute(plugin, attr); } else if (name.equals("fragment") || name.equals("unpack")) { //$NON-NLS-1$ //$NON-NLS-2$ validateBoolean(plugin, attr); } else if (!name.equals("os") && !name.equals("ws") && !name.equals("nl") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ && !name.equals("arch") && !name.equals("download-size") //$NON-NLS-1$ //$NON-NLS-2$
private void validatePlugins(Element parent) { NodeList list = getChildrenByName(parent, "plugin"); //$NON-NLS-1$ for (int i = 0; i < list.getLength(); i++) { if (fMonitor.isCanceled()) return; Element plugin = (Element) list.item(i); assertAttributeDefined(plugin, "id", CompilerFlags.ERROR); //$NON-NLS-1$ assertAttributeDefined(plugin, "version", CompilerFlags.ERROR); //$NON-NLS-1$ NamedNodeMap attributes = plugin.getAttributes(); boolean isFragment = plugin.getAttribute("fragment").equals("true"); //$NON-NLS-1$ //$NON-NLS-2$ for (int j = 0; j < attributes.getLength(); j++) { Attr attr = (Attr) attributes.item(j); String name = attr.getName(); if (name.equals("id")) { //$NON-NLS-1$ validatePluginExists(plugin, attr, isFragment); } else if (name.equals("version")) { //$NON-NLS-1$ validateVersionAttribute(plugin, attr); validateVersion(plugin, attr); } else if (name.equals("fragment") || name.equals("unpack")) { //$NON-NLS-1$ //$NON-NLS-2$ validateBoolean(plugin, attr); } else if (!name.equals("os") && !name.equals("ws") && !name.equals("nl") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ && !name.equals("arch") && !name.equals("download-size") //$NON-NLS-1$ //$NON-NLS-2$ && !name.equals("install-size") && !name.equals("filter")) { //$NON-NLS-1$ //$NON-NLS-2$ reportUnknownAttribute(plugin, name, CompilerFlags.ERROR); } } validateUnpack(plugin); } }
report(NLS.bind(PDECoreMessages.Builders_Feature_patchedVersion, attr.getValue()), getLine(element, attr.getValue()), CompilerFlags.ERROR, PDEMarkerFactory.CAT_FATAL); } else { validateBoolean(element, attr);
PDEMarkerFactory.CAT_FATAL); } else { validateBoolean(element, attr);