|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A reference to a news item located elsewhere.
This class represents a cross-link in the NewsML content tree. Instead of including a NewsItem physically, the content tree may include a pointer to it; the pointer may point to another news item within the same package, or it may point to an external news item using a URL reference.
Fields inherited from interface org.newsml.toolkit.PrimaryNode |
CONTENT_ITEM, NEWS_COMPONENT, NEWS_ITEM, NEWS_ITEM_REF, NEWSML |
Method Summary | |
java.lang.String |
getRef()
Get the reference string. |
NewsItem |
getReferencedNewsItem(boolean useExternal)
Get the referenced NewsItem, if possible. |
Methods inherited from interface org.newsml.toolkit.BaseNode |
getSession, getXMLName |
Methods inherited from interface org.newsml.toolkit.CommentNode |
getComment, getComment, getCommentCount |
Methods inherited from interface org.newsml.toolkit.IdNode |
getDuid, getEuid |
Methods inherited from interface org.newsml.toolkit.PrimaryNode |
asContentItem, asNewsComponent, asNewsItem, asNewsItemRef, asNewsML, getChild, getChild, getChildCount, getNodePath, getParent, getType |
Method Detail |
public java.lang.String getRef()
public NewsItem getReferencedNewsItem(boolean useExternal) throws java.io.IOException
This method will fail for a NewsML URN, but might succeed for an internal reference (beginning with '#') or a URL, depending on whether the target is available.
The URL must point either to a specific NewsItem or to a NewsML package. If the URL points to a complete NewsML package, the first NewsItem in the document will be returned; if that is not what you want, use a fragment identifier to point to the Duid of a different NewsItem.
For any other situations, you can still get a non-URN
referenced resource easily using NewsMLSession.findReference(java.lang.String, boolean)
in the NewsMLSession
(see
BaseNode.getSession()
).
useExternal
- Follow links outside of the current
document.java.io.IOException
- If there is an error retrieving the
news item.NewsMLException
- If the external document is
retrieved successfully but does not have a root element type
of NewsML or NewsItem.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |