use of org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap in project webtools.sourceediting by eclipse.
the class CMPrinter method visitCMDocument.
public void visitCMDocument(CMDocument document) {
// $NON-NLS-1$
fStringBuffer.append(indent + "<CMDocument");
printAttributes(fStringBuffer, document);
// $NON-NLS-1$
fStringBuffer.append(">\n");
incrementIndent();
// printEntities(sb, document.getEntities());
printProperties(fStringBuffer, document);
CMNamedNodeMap map = document.getElements();
int size = map.getLength();
for (int i = 0; i < size; i++) {
visitCMNode(map.item(i));
}
decrementIndent();
// $NON-NLS-1$
fStringBuffer.append(indent + "</CMDocument>\n");
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap in project webtools.sourceediting by eclipse.
the class CMDocumentImpl method toString.
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(super.toString());
// $NON-NLS-1$
buffer.append("\n\t short name:" + StringUtils.escape(getShortname()));
// $NON-NLS-1$
buffer.append("\n\t display name:" + StringUtils.escape(getDisplayName()));
// $NON-NLS-1$
buffer.append("\n\t description (info):" + StringUtils.escape(getDescription()));
// $NON-NLS-1$
buffer.append("\n\t URI:" + StringUtils.escape(getUri()));
// $NON-NLS-1$
buffer.append("\n\t jsp version:" + StringUtils.escape(getJspversion()));
// $NON-NLS-1$
buffer.append("\n\t taglib version:" + StringUtils.escape(getTlibversion()));
// $NON-NLS-1$
buffer.append("\n\t small icon:" + StringUtils.escape(getSmallIcon()));
// $NON-NLS-1$
buffer.append("\n\t large icon:" + StringUtils.escape(getLargeIcon()));
if (getValidator() != null)
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
buffer.append("\n\t validator:" + StringUtils.replace(getValidator().toString(), "\n", "\n\t\t"));
// $NON-NLS-1$
buffer.append("\n\t listeners:");
for (int i = 0; i < getListeners().size(); i++) {
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
buffer.append("\n" + StringUtils.replace(getListeners().get(i).toString(), "\n", "\n\t\t"));
}
// $NON-NLS-1$
buffer.append("\n\t elements:");
CMNamedNodeMap elements = getElements();
for (int i = 0; i < elements.getLength(); i++) {
// $NON-NLS-1$ //$NON-NLS-2$
buffer.append(StringUtils.replace(elements.item(i).toString(), "\n", "\n\t\t"));
}
return buffer.toString();
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap in project webtools.sourceediting by eclipse.
the class StyleAdapterFactory method isTagAvailable.
private static boolean isTagAvailable(Document document, String elementName) {
ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
if (modelQuery != null) {
CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
CMNamedNodeMap map = cmdoc.getElements();
if ((CMElementDeclaration) map.getNamedItem(elementName) != null) {
return true;
}
}
return false;
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap in project webtools.sourceediting by eclipse.
the class CMElementDeclarationBuddySystem method getAttributes.
/*
* @see CMElementDeclaration#getAttributes()
*/
public CMNamedNodeMap getAttributes() {
if (attributes != null)
return attributes;
CMElementDeclaration edecl = getSelf();
if (edecl == null)
return null;
CMElementDeclaration htmlDecl = getBuddy();
CMNamedNodeMap htmlAttrs = (htmlDecl == null) ? null : htmlDecl.getAttributes();
attributes = new Attrs(edecl.getAttributes(), htmlAttrs, isXHTML);
return attributes;
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap in project webtools.sourceediting by eclipse.
the class NamespaceValidator method isUnknownAttr.
private boolean isUnknownAttr(IDOMAttr attr, Element target) {
CMElementDeclaration dec = CMUtil.getDeclaration(target);
if (dec == null)
// unknown.
return true;
CMNamedNodeMap adecls = dec.getAttributes();
CMAttributeDeclaration adec = (CMAttributeDeclaration) adecls.getNamedItem(attr.getName());
return adec == null;
}
Aggregations