public static class LinkParser.Link extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
Link(java.lang.String text)
Create a new Link with text but no reference.
|
protected |
Link(java.lang.String text,
java.lang.String ref)
Create a new link with a given text and hyperlink (reference).
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(org.jdom2.Attribute attr)
Adds another attribute to the link.
|
int |
attributeCount()
Returns the number of attributes on this link.
|
java.util.Iterator<org.jdom2.Attribute> |
getAttributes()
Returns an Iterator over the list of JDOM Attributes.
|
java.lang.String |
getExternalWiki()
Returns the name of the wiki if this is an interwiki link.
|
java.lang.String |
getExternalWikiPage()
Returns the wikiname part of an interwiki link.
|
java.lang.String |
getReference()
Returns the link reference, or the link text if null.
|
java.lang.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(java.lang.String ref)
Sets the hypertext reference.
|
protected void |
setText(java.lang.String text)
Sets the link text.
|
java.lang.String |
toString()
Returns a wikitext string representation of this Link.
|
protected Link(java.lang.String text) throws ParseException
text - The link text.ParseException - If the link text is illegal.protected Link(java.lang.String text, java.lang.String ref) throws ParseException
text - The link text.ref - The hypertext reference.ParseException - If the link text or reference are illegal.protected void setText(java.lang.String text) throws ParseException
text - The link text.ParseException - If the text is illegal (e.g. null).public java.lang.String getText()
protected void setReference(java.lang.String ref) throws ParseException
ref - The reference.ParseException - If the reference is illegal.public boolean hasReference()
public java.lang.String getReference()
public boolean isInterwikiLink()
public java.lang.String getExternalWiki()
Link link = new Link("Foo","Wikipedia:Foobar");
assert( link.getExternalWikiPage(), "Wikipedia" );
public java.lang.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 java.util.Iterator<org.jdom2.Attribute> getAttributes()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.