本文整理了Java中org.jdom2.Element.getQualifiedName()
方法的一些代码示例,展示了Element.getQualifiedName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getQualifiedName()
方法的具体详情如下:
包路径:org.jdom2.Element
类名称:Element
方法名:getQualifiedName
[英]Returns the full name of the element, in the form [namespacePrefix]:[localName]. If the element does not have a namespace prefix, then the local name is returned.
[中]返回元素的全名,格式为[namespacePrefix]:[localName]。如果元素没有名称空间前缀,则返回本地名称。
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link Element}</code>
* to parent is illegal.
*
* @param base <code>Element</code> that the child
* couldn't be added to
* @param added <code>Element</code> that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element base, Element added, String reason) {
super(new StringBuilder()
.append("The element \"")
.append(added.getQualifiedName())
.append("\" could not be added as a child of \"")
.append(base.getQualifiedName())
.append("\": ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link Element}</code>
* to the <code>{@link Document}</code> is illegal.
*
* @param added <code>Element</code> that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element added, String reason) {
super(new StringBuilder()
.append("The element \"")
.append(added.getQualifiedName())
.append("\" could not be added as the root of the document: ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link Attribute}</code>
* to the <code>{@link Element}</code> is illegal.
*
* @param base <code>Element</code> that <code>Attribute</code>
* couldn't be added to
* @param added <code>Attribute</code> that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element base, Attribute added, String reason) {
super(new StringBuilder()
.append("The attribute \"")
.append(added.getQualifiedName())
.append("\" could not be added to the element \"")
.append(base.getQualifiedName())
.append("\": ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link CDATA}</code>
*
* @param base <code>Element</code> that the <code>CDATA</code>
* couldn't be added to
* @param added <code>CDATA</code> that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element base, CDATA added, String reason) {
super(new StringBuilder()
.append("The CDATA \"")
.append(added.getText())
.append("\" could not be added as content to \"")
.append(base.getQualifiedName())
.append("\": ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link EntityRef}</code>
* to the <code>{@link Element}</code> is illegal.
*
* @param base <code>Element</code> that the <code>EntityRef</code>
* couldn't be added to
* @param added <code>EntityRef</code> reference that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element base, EntityRef added, String reason) {
super(new StringBuilder()
.append("The entity reference\"")
.append(added.getName())
.append("\" could not be added as content to \"")
.append(base.getQualifiedName())
.append("\": ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link Text}</code>
* to the <code>{@link Element}</code> is illegal.
*
* @param base <code>Element</code> that the <code>Comment</code>
* couldn't be added to
* @param added <code>Text</code> that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element base, Text added, String reason) {
super(new StringBuilder()
.append("The Text \"")
.append(added.getText())
.append("\" could not be added as content to \"")
.append(base.getQualifiedName())
.append("\": ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link Comment}</code>
* to the <code>{@link Element}</code> is illegal.
*
* @param base <code>Element</code> that the <code>Comment</code>
* couldn't be added to
* @param added <code>Comment</code> that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element base, Comment added, String reason) {
super(new StringBuilder()
.append("The comment \"")
.append(added.getText())
.append("\" could not be added as content to \"")
.append(base.getQualifiedName())
.append("\": ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link ProcessingInstruction}</code>
* to the <code>{@link Element}</code> is illegal.
*
* @param base <code>Element</code> that the
* <code>ProcessingInstruction</code> couldn't be added to
* @param added <code>ProcessingInstruction</code> that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element base, ProcessingInstruction added,
String reason) {
super(new StringBuilder()
.append("The PI \"")
.append(added.getTarget())
.append("\" could not be added as content to \"")
.append(base.getQualifiedName())
.append("\": ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
/**
* <p>
* This returns a <code>String</code> representation of the
* <code>Element</code>, suitable for debugging. If the XML
* representation of the <code>Element</code> is desired,
* {@link org.jdom2.output.XMLOutputter#outputString(Element)}
* should be used.
* </p>
*
* @return <code>String</code> - information about the
* <code>Element</code>
*/
@Override
public String toString() {
final StringBuilder stringForm = new StringBuilder(64)
.append("[Element: <")
.append(getQualifiedName());
final String nsuri = getNamespaceURI();
if (!"".equals(nsuri)) {
stringForm
.append(" [Namespace: ")
.append(nsuri)
.append("]");
}
stringForm.append("/>]");
return stringForm.toString();
}
代码示例来源:origin: org.jdom/jdom
/**
* This will create an <code>Exception</code> indicating
* that the addition of the <code>{@link Namespace}</code>
* to the <code>{@link Element}</code> is illegal.
*
* @param base <code>Element</code> that the <code>Namespace</code>
* couldn't be added to
* @param added <code>Namespace</code> that could not be added
* @param reason cause of the problem
*/
IllegalAddException(Element base, Namespace added, String reason) {
super(new StringBuilder()
.append("The namespace xmlns")
.append(added.getPrefix().equals("") ? "="
: ":" + added.getPrefix() + "=")
.append("\"")
.append(added.getURI())
.append("\" could not be added as a namespace to \"")
.append(base.getQualifiedName())
.append("\": ")
.append(reason)
.toString());
}
代码示例来源:origin: org.jdom/jdom
private final void checkPreConditions(final Content child, final int index,
final boolean replace) {
if (child == null) {
throw new NullPointerException("Cannot add null object");
}
checkIndex(index, replace);
if (child.getParent() != null) {
// the content to be added already has a parent.
final Parent p = child.getParent();
if (p instanceof Document) {
throw new IllegalAddException((Element) child,
"The Content already has an existing parent document");
}
throw new IllegalAddException(
"The Content already has an existing parent \"" +
((Element) p).getQualifiedName() + "\"");
}
if (child == parent) {
throw new IllegalAddException(
"The Element cannot be added to itself");
}
// Detect if we have <a><b><c/></b></a> and c.add(a)
if ((parent instanceof Element && child instanceof Element) &&
((Element) child).isAncestor((Element) parent)) {
throw new IllegalAddException(
"The Element cannot be added as a descendent of itself");
}
}
代码示例来源:origin: org.codehaus.plexus/plexus-component-metadata
/**
* @return The qualified name.
* @see org.jdom2.Element#getQualifiedName()
*/
public String getQualifiedName()
{
return element.getQualifiedName();
}
代码示例来源:origin: org.jdom/jdom
throw new IllegalAddException(
"The attribute already has an existing parent \"" +
attribute.getParent().getQualifiedName() + "\"");
代码示例来源:origin: org.jdom/jdom
element.getNamespaceURI(), element.getQualifiedName());
代码示例来源:origin: org.jdom/jdom
throw new IllegalAddException(
"The attribute already has an existing parent \"" +
attribute.getParent().getQualifiedName() + "\"");
代码示例来源:origin: net.sourceforge/jwbf
@CheckForNull
public String getQualifiedName() {
if (element.isPresent()) {
return element.get().getQualifiedName();
} else {
return null;
}
}
代码示例来源:origin: org.jdom/jdom
write(out, element.getQualifiedName());
write(out, element.getQualifiedName());
write(out, ">");
write(out, element.getQualifiedName());
write(out, ">");
write(out, element.getQualifiedName());
write(out, ">");
代码示例来源:origin: org.jdom/jdom
element.getQualifiedName(), atts);
element.getName(), element.getQualifiedName());
代码示例来源:origin: org.codehaus.izpack/izpack-util
@Override
public boolean matches(Element originalElement, Element patchElement)
{
return equalsString(originalElement.getQualifiedName(), patchElement.getQualifiedName(),
ignoreCaseElementName());
}
代码示例来源:origin: org.mycore/mycore-mods
public static void assignCategory(org.jdom2.Element modsElement, MCRCategoryID categID) {
MCRAuthorityInfo authInfo = modsElement.getNamespace().equals(MCRConstants.MODS_NAMESPACE)
? getAuthInfo(categID, modsElement.getName())
: null;
if (authInfo == null) {
throw new MCRException(modsElement.getQualifiedName() + " could not be assigned to category " + categID);
}
authInfo.setInElement(modsElement);
}
内容来源于网络,如有侵权,请联系作者删除!