|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wiki.parser.LinkParser.Link
public static class LinkParser.Link
Inner class serving as a struct containing the parsed components of a link.
Constructor Summary | |
---|---|
protected |
LinkParser.Link(String text)
Create a new Link with text but no reference. |
protected |
LinkParser.Link(String text,
String ref)
Create a new link with a given text and hyperlink (reference). |
Method Summary | |
---|---|
void |
addAttribute(org.jdom2.Attribute attr)
Adds another attribute to the link. |
int |
attributeCount()
Returns the number of attributes on this link. |
Iterator |
getAttributes()
Returns an Iterator over the list of JDOM Attributes. |
String |
getExternalWiki()
Returns the name of the wiki if this is an interwiki link. |
String |
getExternalWikiPage()
Returns the wikiname part of an interwiki link. |
String |
getReference()
Returns the link reference, or the link text if null. |
String |
getText()
Returns the link text. |
boolean |
hasReference()
Returns true, if there is a reference. |
boolean |
isInterwikiLink()
Returns true, if this Link represents an InterWiki link (of the form wiki:page). |
protected void |
setReference(String ref)
Sets the hypertext reference. |
protected void |
setText(String text)
Sets the link text. |
String |
toString()
Returns a wikitext string representation of this Link. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected LinkParser.Link(String text) throws ParseException
text
- The link text.
ParseException
- If the link text is illegal.protected LinkParser.Link(String text, String ref) throws ParseException
text
- The link text.ref
- The hypertext reference.
ParseException
- If the link text or reference are illegal.Method Detail |
---|
protected void setText(String text) throws ParseException
text
- The link text.
ParseException
- If the text is illegal (e.g. null).public String getText()
protected void setReference(String ref) throws ParseException
ref
- The reference.
ParseException
- If the reference is illegal.public boolean hasReference()
public String getReference()
public boolean isInterwikiLink()
public String getExternalWiki()
Link link = new Link("Foo","Wikipedia:Foobar"); assert( link.getExternalWikiPage(), "Wikipedia" );
public String getExternalWikiPage()
Link link = new Link("Foo","Wikipedia:Foobar"); assert( link.getExternalWikiPage(), "Foobar" );
public int attributeCount()
public void addAttribute(org.jdom2.Attribute attr)
attr
- A JDOM Attribute.public Iterator getAttributes()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |