本文整理匯總了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;
}