public Elements() { CMNamedNodeMap elems = hcm.getElements(); for (int i = 0; i < names.length; i++) { String name = names[i]; CMElementDeclaration dec = (CMElementDeclaration) elems.getNamedItem(name); if (dec != null) map.put(name, dec); } }
public CMNamedNodeMap getEntities() { CMDocument cmdoc = getSelf(); if (cmdoc == null) return null; return cmdoc.getEntities(); }
/** * getNodeName method * @return java.lang.String */ public String getNodeName() { return getDocument().getNodeName(); }
public void debugPrint(Collection collection) { for (Iterator iter = collection.iterator(); iter.hasNext(); ) { CMDocument cmDocument = (CMDocument)iter.next(); System.out.println("-----------------------------------------------"); //$NON-NLS-1$ System.out.println("cmDocument (" + cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI") +")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ CMNamedNodeMapImpl elementMap = (CMNamedNodeMapImpl)cmDocument.getElements(); int size = elementMap.getLength(); for (int i = 0; i < size; i++) { CMElementDeclaration ed = (CMElementDeclaration)elementMap.item(i); CMDescriptionBuilder builder = new CMDescriptionBuilder(); System.out.println(" ELEMENT " + ed.getNodeName() + " = " + builder.buildDescription(ed)); //$NON-NLS-1$ //$NON-NLS-2$ } } } }
/** * Get the taginfo for this current element * * @return String taginfo if it exists, null otherwise */ private String getTagInfo() { if (getOwnerDocument().supports("annotationMap")) { //$NON-NLS-1$ AnnotationMap map = (AnnotationMap) getOwnerDocument().getProperty("annotationMap"); //$NON-NLS-1$ String spec = getSpec(); String result = map.getProperty(spec, "tagInfo"); //$NON-NLS-1$ return result; // bug88336 no need to restore markers // return StringUtils.restoreMarkers(result); // return tag info } return null; }
/** * getProperty method * @return java.lang.Object * * Returns the object property desciped by the propertyName * */ public Object getProperty(String propertyName) { return getDocument().getProperty(propertyName); }
CMNamedNodeMap nameNodeMap = cmDocument.getElements(); CMElementDeclaration cmElementDeclaration = (CMElementDeclaration) nameNodeMap.getNamedItem(getRootElementName()); domWriter.print(xmlDocument, charset, cmDocument.getNodeName(), getNonWhitespaceString(getPublicId()), getNonWhitespaceString(getSystemId())); outputStream.flush(); outputStream.close();
/** * getNodeType method * @return int * * Returns one of : * */ public int getNodeType() { return getDocument().getNodeType(); }
public CMNamespace getNamespace() { CMDocument cmdoc = getSelf(); if (cmdoc == null) return null; return cmdoc.getNamespace(); }
private String getNamespace(CMNode cmNode) { String namespace = null; CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$ if (cmDocument != null) { namespace = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$ } return namespace; }
CMNamedNodeMap nameNodeMap = generator.getCMDocument().getElements(); Vector nameNodeVector = new Vector(); String defaultRootName = (String) (generator.getCMDocument()).getProperty("http://org.eclipse.wst/cm/properties/defaultRootName"); //$NON-NLS-1$ int defaultRootIndex = -1; combo.removeAll();
public CMElementDeclaration getCMElementDeclaration(Element element) { CMElementDeclaration result = null; CMDocument cmDocument = getCorrespondingCMDocument(element); if (cmDocument != null) { result = (CMElementDeclaration)cmDocument.getElements().getNamedItem(element.getNodeName()); } return result; } }
protected String getFallbackNamepaceURI(CMElementDeclaration ed) { String fallbackNamepaceURI = null; CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$ if (cmDocument != null) { fallbackNamepaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$ } return fallbackNamepaceURI; }
/** * getEntities method * @return CMNamedNodeMap * * Returns CMNamedNodeMap of EntityDeclaration */ public CMNamedNodeMap getEntities() { if (fEntities == null) { fEntities = getDocument().getEntities(); } return fEntities; }
public void createDefaultRootContent(CMDocument cmDocument, CMElementDeclaration rootCMElementDeclaration) throws Exception { String grammarFileName = cmDocument.getNodeName(); if (!supressCreationOfDoctypeAndXMLDeclaration) {
protected void addBlockMarkers(CMDocument doc) { if (doc.getElements().getLength() > 0) { Iterator elements = doc.getElements().iterator(); CMNode node = null; while (elements.hasNext()) { node = (CMNode) elements.next(); getBlockMarkers().add(new BlockMarker(node.getNodeName(), null, DOMJSPRegionContexts.JSP_CONTENT, true)); } } }
/** * getProperty method * * @return java.lang.Object * * Returns the object property desciped by the propertyName * */ public Object getProperty(String propertyName) { if (propertyName != null && propertyName.equals(JSP12TLDNames.DESCRIPTION)) { return getDescription(); // return attribute description } else if (propertyName.equals(TLDDocument.CM_KIND)) { return TLDDocument.JSP_TLD; } else if (propertyName.equals(JSP12TLDNames.SMALL_ICON) || propertyName.equals(JSP12TLDNames.LARGE_ICON)) { return getOwnerDocument().getProperty(propertyName); } return null; }
CMNamedNodeMap map = cm.getEntities(); if (map != null) { CMEntityDeclaration decl = (CMEntityDeclaration) map.getNamedItem(name);
public CMNamedNodeMap getElements() { if (elements != null) return elements; CMDocument cmdoc = getSelf(); if (cmdoc == null) return null; elements = new Elements(cmdoc.getElements(), isXHTML); return elements; }
public boolean isXSIType(CMAttributeDeclaration ad) { boolean result = false; if (ad.getNodeName().equals("type")) //$NON-NLS-1$ { CMDocument cmDocument = (CMDocument)ad.getProperty("CMDocument"); //$NON-NLS-1$ if (cmDocument != null) { String namespaceName = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$ if (namespaceName != null && namespaceName.equals("http://www.w3.org/2001/XMLSchema-instance")) //$NON-NLS-1$ { result = true; } } } return result; }