public ChildHandler(AbstractHandler parentHandler, Attributes attributes, List<URI> repos) { super(parentHandler, CHILD_ELEMENT); String[] values = parseAttributes(attributes, required, optional); this.repos = repos; //skip entire subrepository if the location is missing if (values[0] == null) return; currentRepo = checkURI(REQUIRED_CAPABILITY_ELEMENT, URI_ATTRIBUTE, values[0]); }
/** * An implementation for startElement when there are no sub-elements */ protected void noSubElements(String name, Attributes attributes) { unexpectedElement(this, name, attributes); // Create a new handler to ignore subsequent nested elements new IgnoringHandler(this); }
public Map<String, String> getProperties() { if (propertiesHandler == null) return null; return propertiesHandler.getProperties(); }
public void duplicateElement(AbstractHandler handler, String element, Attributes attributes) { addError(IStatus.WARNING, NLS.bind(Messages.XMLParser_Duplicate_Element, new Object[] {handler.getName(), element, toString(attributes)}), null); //ignore the duplicate element entirely because we have already logged it new IgnoringHandler(handler); }
/** * Writes a list of URIs referring to sub repositories */ protected void writeChildren(URI[] children) { if (children == null || children.length == 0) return; start(CHILDREN_ELEMENT); attribute(COLLECTION_SIZE_ATTRIBUTE, children.length); for (int i = 0; i < children.length; i++) writeChild(children[i]); end(CHILDREN_ELEMENT); }
public void cdata(String data, boolean escape) { if (this.open) { println('>'); this.open = false; } if (data != null) { printlnIndented(data, escape); } }
/** * Parse the attributes of an element with a single optional attribute. */ protected String parseOptionalAttribute(Attributes attributes, String name) { return parseAttributes(attributes, noAttributes, new String[] {name})[0]; }
public ProcessingInstruction(String target, String[] attrs, String[] values) { // Lengths of attributes and values must be the same this.target = target; this.data = new String[attrs.length]; for (int i = 0; i < attrs.length; i++) { data[i] = attributeImage(attrs[i], values[i]); } }
public void initialize(DocHandler document, String rootName, Attributes attributes) { this.parentHandler = document; this.elementHandled = rootName; handleRootAttributes(attributes); }
public void attribute(String name, boolean value, boolean defaultValue) { if (value != defaultValue) { attribute(name, value); } }
public Map<String, String> getProperties() { if (propertiesHandler == null) return null; return propertiesHandler.getProperties(); }
public void duplicateElement(AbstractHandler handler, String element, Attributes attributes) { addError(IStatus.WARNING, NLS.bind(Messages.XMLParser_Duplicate_Element, new Object[] {handler.getName(), element, toString(attributes)}), null); //ignore the duplicate element entirely because we have already logged it new IgnoringHandler(handler); }
/** * An implementation for startElement when there are no sub-elements */ protected void noSubElements(String name, Attributes attributes) { unexpectedElement(this, name, attributes); // Create a new handler to ignore subsequent nested elements new IgnoringHandler(this); }
public ChildHandler(AbstractHandler parentHandler, Attributes attributes, List<URI> repos) { super(parentHandler, CHILD_ELEMENT); String[] values = parseAttributes(attributes, required, optional); this.repos = repos; //skip entire subrepository if the location is missing if (values[0] == null) return; currentRepo = checkURI(REQUIRED_CAPABILITY_ELEMENT, URI_ATTRIBUTE, values[0]); }
/** * Parse the attributes of an element with only required attributes. */ protected String[] parseRequiredAttributes(Attributes attributes, String[] required) { return parseAttributes(attributes, required, noAttributes); }
public ProcessingInstruction(String target, String[] attrs, String[] values) { // Lengths of attributes and values must be the same this.target = target; this.data = new String[attrs.length]; for (int i = 0; i < attrs.length; i++) { data[i] = attributeImage(attrs[i], values[i]); } }
public void invalidElement(String name, Attributes attributes) { unexpectedElement(this, name, attributes); new IgnoringHandler(this); }
/** * Parse the attributes of an element with only required attributes. */ protected String[] parseRequiredAttributes(Attributes attributes, String[] required) { return parseAttributes(attributes, required, noAttributes); }
public void invalidElement(String name, Attributes attributes) { unexpectedElement(this, name, attributes); new IgnoringHandler(this); }