/** * Get the defined element attributes for the named element. * @param elementName The element name. * @return The list of attribute names ({@link String}s) for the named element. * @throws ElementNotDefined Element not defined. Calls shouldn't be made to this * function for undefined elements. */ @SuppressWarnings({ "WeakerAccess", "unchecked" }) public List getElementAttributes(String elementName) throws ElementNotDefined { Vector attributes = (Vector)elementAttributes.get(elementName); if(attributes == null) { DTDElement element = getElement(elementName); if(element != null) { attributes = new Vector(); elementAttributes.put(elementName, attributes); attributes.addAll(element.attributes.keySet()); } else { throw new ElementNotDefined("Element [" + elementName + "] not defined in DTD."); } } return attributes; }
/** * Get the defined element attributes for the named element. * @param elementName The element name. * @return The list of attribute names ({@link String}s) for the named element. * @throws ElementNotDefined Element not defined. Calls shouldn't be made to this * function for undefined elements. */ @SuppressWarnings({ "WeakerAccess", "unchecked" }) public List getElementAttributes(String elementName) throws ElementNotDefined { Vector attributes = (Vector)elementAttributes.get(elementName); if(attributes == null) { DTDElement element = getElement(elementName); if(element != null) { attributes = new Vector(); elementAttributes.put(elementName, attributes); attributes.addAll(element.attributes.keySet()); } else { throw new ElementNotDefined("Element [" + elementName + "] not defined in DTD."); } } return attributes; }
/** * Get the defined element attributes for the named element. * @param elementName The element name. * @return The list of attribute names ({@link String}s) for the named element. * @throws ElementNotDefined Element not defined. Calls shouldn't be made to this * function for undefined elements. */ public List getElementAttributes(String elementName) throws ElementNotDefined { Vector attributes = (Vector)elementAttributes.get(elementName); if(attributes == null) { DTDElement element = getElement(elementName); if(element != null) { attributes = new Vector(); elementAttributes.put(elementName, attributes); attributes.addAll(element.attributes.keySet()); } else { throw new ElementNotDefined("Element [" + elementName + "] not defined in DTD."); } } return attributes; }
/** * Get the child elements for the named element. * <p/> * PCData is returned as a "*" list entry. * @param elementName Element name. * @return List of allowed element names ({@link String}s). */ @SuppressWarnings({ "WeakerAccess", "unchecked" }) public List getChildElements(String elementName) { Vector childElements = (Vector)elementElements.get(elementName); if(childElements == null) { DTDElement element = getElement(elementName); if(element != null) { childElements = new Vector(); elementElements.put(elementName, childElements); if(element.content instanceof DTDContainer) { DTDContainer container = (DTDContainer)element.content; Vector itemsVec = container.getItemsVec(); for(int i = 0; i < itemsVec.size(); i++) { Object item = itemsVec.elementAt(i); if(item instanceof DTDName) { childElements.add(((DTDName)item).getValue()); } } } } } return childElements; }
DTDElement element = getElement(elementName);
/** * Get the child elements for the named element. * <p/> * PCData is returned as a "*" list entry. * @param elementName Element name. * @return List of allowed element names ({@link String}s). */ @SuppressWarnings({ "WeakerAccess", "unchecked" }) public List getChildElements(String elementName) { Vector childElements = (Vector)elementElements.get(elementName); if(childElements == null) { DTDElement element = getElement(elementName); if(element != null) { childElements = new Vector(); elementElements.put(elementName, childElements); if(element.content instanceof DTDContainer) { DTDContainer container = (DTDContainer)element.content; Vector itemsVec = container.getItemsVec(); for(int i = 0; i < itemsVec.size(); i++) { Object item = itemsVec.elementAt(i); if(item instanceof DTDName) { childElements.add(((DTDName)item).getValue()); } } } } } return childElements; }
/** * Get the defined element attributes for the named element. * @param elementName The element name. * @return The list of attribute names ({@link String}s) for the named element. * @throws ElementNotDefined Element not defined. Calls shouldn't be made to this * function for undefined elements. */ @SuppressWarnings({ "WeakerAccess", "unchecked" }) public List getElementAttributes(String elementName) throws ElementNotDefined { Vector attributes = (Vector)elementAttributes.get(elementName); if(attributes == null) { DTDElement element = getElement(elementName); if(element != null) { attributes = new Vector(); elementAttributes.put(elementName, attributes); attributes.addAll(element.attributes.keySet()); } else { throw new ElementNotDefined("Element [" + elementName + "] not defined in DTD."); } } return attributes; }
/** * Get the child elements for the named element. * <p/> * PCData is returned as a "*" list entry. * @param elementName Element name. * @return List of allowed element names ({@link String}s). */ @SuppressWarnings({ "WeakerAccess", "unchecked" }) public List getChildElements(String elementName) { Vector childElements = (Vector)elementElements.get(elementName); if(childElements == null) { DTDElement element = getElement(elementName); if(element != null) { childElements = new Vector(); elementElements.put(elementName, childElements); if(element.content instanceof DTDContainer) { DTDContainer container = (DTDContainer)element.content; Vector itemsVec = container.getItemsVec(); for(int i = 0; i < itemsVec.size(); i++) { Object item = itemsVec.elementAt(i); if(item instanceof DTDName) { childElements.add(((DTDName)item).getValue()); } } } } } return childElements; }