本文整理汇总了Java中org.jdom.Namespace.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Namespace.equals方法的具体用法?Java Namespace.equals怎么用?Java Namespace.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdom.Namespace
的用法示例。
在下文中一共展示了Namespace.equals方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isMyType
import org.jdom.Namespace; //导入方法依赖的package包/类
/**
* Indicates if a JDom document is an RSS instance that can be parsed with the parser.
* <p/>
* It checks for RDF ("http://www.w3.org/1999/02/22-rdf-syntax-ns#") and
* RSS ("http://purl.org/rss/1.0/") namespaces being defined in the root element.
*
* @param document document to check if it can be parsed with this parser implementation.
* @return <b>true</b> if the document is RSS1., <b>false</b> otherwise.
*/
public boolean isMyType(Document document) {
boolean ok = false;
Element rssRoot = document.getRootElement();
Namespace defaultNS = rssRoot.getNamespace();
List additionalNSs = rssRoot.getAdditionalNamespaces();
ok = defaultNS!=null && defaultNS.equals(getRDFNamespace());
if (ok) {
if (additionalNSs==null) {
ok = false;
}
else {
ok = false;
for (int i=0;!ok && i<additionalNSs.size();i++) {
ok = getRSSNamespace().equals(additionalNSs.get(i));
}
}
}
return ok;
}
示例2: isMyType
import org.jdom.Namespace; //导入方法依赖的package包/类
public boolean isMyType(Document document) {
boolean ok = false;
Element rssRoot = document.getRootElement();
Namespace defaultNS = rssRoot.getNamespace();
List additionalNSs = rssRoot.getAdditionalNamespaces();
ok = defaultNS!=null && defaultNS.equals(getRDFNamespace());
if (ok) {
if (additionalNSs==null) {
ok = false;
}
else {
ok = false;
for (int i=0;!ok && i<additionalNSs.size();i++) {
ok = getRSSNamespace().equals(additionalNSs.get(i));
}
}
}
return ok;
}
示例3: hasElementsFrom
import org.jdom.Namespace; //导入方法依赖的package包/类
private boolean hasElementsFrom(Element root,Namespace namespace) {
boolean itHas = false;
List children = root.getChildren();
for (int i=0;!itHas && i<children.size();i++) {
Element child = (Element) children.get(i);
itHas = namespace.equals(child.getNamespace());
}
return itHas;
}
示例4: isMyType
import org.jdom.Namespace; //导入方法依赖的package包/类
public boolean isMyType(Document document) {
Element rssRoot = document.getRootElement();
Namespace defaultNS = rssRoot.getNamespace();
boolean ok = defaultNS!=null && defaultNS.equals(getRSSNamespace());
if (ok) {
ok = super.isMyType(document);
}
return ok;
}
示例5: isMyType
import org.jdom.Namespace; //导入方法依赖的package包/类
public boolean isMyType(Document document) {
Element rssRoot = document.getRootElement();
Namespace defaultNS = rssRoot.getNamespace();
return (defaultNS!=null) && defaultNS.equals(getAtomNamespace());
}
示例6: getReaderForNamespace
import org.jdom.Namespace; //导入方法依赖的package包/类
public static GpmlFormatReader getReaderForNamespace (Namespace ns)
{
GpmlFormatReader[] formats = new GpmlFormatReader[]
{
GpmlFormat200X.GPML_2007, GpmlFormat200X.GPML_2008A, GpmlFormat2010a.GPML_2010A , GpmlFormat2013a.GPML_2013A
};
for (GpmlFormatReader format : formats)
{
if (ns.equals(format.getGpmlNamespace()))
{
return format;
}
}
return null;
}
示例7: parseContent
import org.jdom.Namespace; //导入方法依赖的package包/类
public void
parseContent(DefaultHandler the_handler,
CartridgeLoader the_cartridge,
Element the_resource,
boolean isProtected) throws ParseException {
// none of this is used
if (false) {
try {
//ok, so we're looking at a discussion topic here...
Element discussion = getXML(the_cartridge, ((Element)the_resource.getChildren(FILE, the_handler.getNs().cc_ns()).get(0)).getAttributeValue(HREF));
Namespace topicNs = the_handler.getNs().topic_ns();
the_handler.startDiscussion(discussion.getChildText(TITLE, topicNs),
discussion.getChild(TEXT, topicNs).getAttributeValue(TEXTTYPE),
discussion.getChildText(TEXT, topicNs),
isProtected);
the_handler.setDiscussionXml(discussion);
//discussion may have attachments
XPath path = XPath.newInstance(ATTACHMENT_QUERY);
if (!topicNs.equals(Namespace.NO_NAMESPACE))
path.addNamespace(topicNs);
for (Iterator iter=path.selectNodes(discussion).iterator(); iter.hasNext();) {
the_handler.addAttachment(((Element)iter.next()).getAttributeValue(HREF));
}
the_handler.endDiscussion();
} catch (IOException e) {
throw new ParseException(e);
} catch (JDOMException je) {
throw new ParseException(je);
}
}
}
示例8: hasElementsFrom
import org.jdom.Namespace; //导入方法依赖的package包/类
private boolean hasElementsFrom(Element root, Namespace namespace) {
boolean hasElements = false;
// boolean hasElements = namespace.equals(root.getNamespace());
if (!hasElements) {
List children = root.getChildren();
for (int i=0;!hasElements && i < children.size();i++) {
Element child = (Element) children.get(i);
hasElements = namespace.equals(child.getNamespace());
}
}
return hasElements;
}