public static class LinkParser.Link extends Object
Modifier | Constructor and Description |
---|---|
protected |
Link(String text)
Create a new Link with text but no reference.
|
protected |
Link(String text,
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.
|
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.
|
protected Link(String text) throws ParseException
text
- The link text.ParseException
- If the link text is illegal.protected Link(String text, String ref) throws ParseException
text
- The link text.ref
- The hypertext reference.ParseException
- If the link text or reference are illegal.protected void setText(String text) throws ParseException
text
- The link text.ParseException
- If the text is illegal (e.g. null).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()
Copyright © 2001-2018 The Apache Software Foundation. All rights reserved.