public class XMLReference extends java.lang.Object implements ParagraphArticleReference, StyledElement
XMLArticle.getID()XMLArticle.getDescription()<ref id="refID" desc="the description" />This links to the article which ID is "refID".
<ref id="refID#the chapter" desc="the description" />This links to the article which ID is "refID", and chapter with the title "the chapter".
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
desc
The reference desctiption.
|
protected java.lang.String |
id
The reference ID.
|
protected boolean |
idMayBeDesc
True if the raw ID maybe a description.
|
protected java.lang.String |
rawID
The raw article title ID.
|
TYPE_NONE| Constructor and Description |
|---|
XMLReference(Article article)
Constructor.
|
XMLReference(Article article,
java.lang.String rawID,
java.lang.String pack)
Constructor.
|
XMLReference(Article article,
java.lang.String rawID,
java.lang.String pack,
boolean isBareReference)
Constructor.
|
XMLReference(java.lang.String rawID,
java.lang.String pack)
Constructor without input article.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind(XMLParentArticle article)
Set the referenced article.
|
void |
bind(XMLParentArticle article,
AnchorElement anchor)
Set the referenced article and associated chapter or title.
|
AnchorElement |
getAnchorElement()
Return the referenced anchor element.
|
ArticleRef |
getArticleRef()
Return the associated reference.
|
java.util.Set<java.lang.String> |
getCustomStyles()
Return the element custom classes.
|
java.lang.String |
getDeclaration()
Return the declaration ID of the element.
|
java.lang.String |
getDesc()
Return the reference text.
|
protected java.lang.String |
getDescription(XMLParentArticle article,
java.lang.String refID)
Return the description associated to an ID and an article.
|
java.lang.String |
getInlinedStyle()
Return the element custom inline style.
|
int |
getLineNumber()
Return the line where the reference appear.
|
Article |
getOriginArticle()
Return the article which emit the reference.
|
XMLParentArticle |
getReferencedArticle()
Return the referenced article.
|
java.lang.String |
getRefID()
Return the other article reference ID.
|
java.lang.String |
getRefPackage()
Return the article reference package.
|
java.lang.String |
getStyle()
Return the style class of the element.
|
boolean |
isAutoDesc()
Return true if the description has been set automatically.
|
boolean |
isBareReference()
Return true for a bare reference pointing directly to a File.
|
boolean |
isBound()
Return true if the reference is bound.
|
void |
setCustomStyles(java.util.Set<java.lang.String> classes)
Set the element custom classes.
|
void |
setDesc(java.lang.String desc)
Set the reference text.
|
void |
setInlinedStyle(java.lang.String style)
Set the element custom inline style.
|
void |
setLineNumber(int lineNumber)
Set the line number where the reference appear.
|
void |
setLowerCase(boolean lowerCase)
Set that the first character of the reference should be kept in lower case.
|
void |
setStyle(java.lang.String style)
Set the style class of the reference.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasInlinedStyle, setCustomStyleshasLineNumberprotected java.lang.String id
protected java.lang.String rawID
protected boolean idMayBeDesc
protected java.lang.String desc
public XMLReference(Article article)
article - the article which emit the referencepublic XMLReference(Article article, java.lang.String rawID, java.lang.String pack, boolean isBareReference)
article - the article which emit the referencerawID - the raw reference IDpack - the packageisBareReference - true for a bare reference pointing directly to a Filepublic XMLReference(Article article, java.lang.String rawID, java.lang.String pack)
article - the article which emit the referencerawID - the raw reference IDpack - the packagepublic XMLReference(java.lang.String rawID,
java.lang.String pack)
rawID - the raw reference IDpack - the packagepublic void setLineNumber(int lineNumber)
lineNumber - the line numberpublic int getLineNumber()
getLineNumber in interface ElementReferencepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDeclaration()
getDeclaration in interface StyledElementpublic boolean isAutoDesc()
isAutoDesc in interface ArticleReferencepublic boolean isBareReference()
isBareReference in interface ArticleReferencepublic void setStyle(java.lang.String style)
style - the style classpublic java.lang.String getStyle()
getStyle in interface StyledElementpublic void setInlinedStyle(java.lang.String style)
setInlinedStyle in interface StyledElementstyle - the element custom inline stylepublic java.lang.String getInlinedStyle()
getInlinedStyle in interface StyledElementpublic void setCustomStyles(java.util.Set<java.lang.String> classes)
setCustomStyles in interface StyledElementclasses - the custom element classespublic java.util.Set<java.lang.String> getCustomStyles()
getCustomStyles in interface StyledElementpublic void setLowerCase(boolean lowerCase)
lowerCase - true if the first character of the reference should be kept in lower casepublic Article getOriginArticle()
public XMLParentArticle getReferencedArticle()
getReferencedArticle in interface ArticleReferencepublic boolean isBound()
isBound in interface ArticleReferencepublic void setDesc(java.lang.String desc)
setDesc in interface ArticleReferencedesc - the reference textpublic java.lang.String getRefID()
XMLArticle.getDescription()XMLArticle.getID()getRefID in interface ArticleReferencepublic java.lang.String getRefPackage()
getRefPackage in interface ArticleReferenceprotected java.lang.String getDescription(XMLParentArticle article, java.lang.String refID)
article - the parent articlerefID - the IDpublic java.lang.String getDesc()
getDesc in interface ArticleReferencepublic AnchorElement getAnchorElement()
getAnchorElement in interface ArticleReferencepublic ArticleRef getArticleRef()
getArticleRef in interface ArticleReferencepublic void bind(XMLParentArticle article)
bind in interface ArticleReferencearticle - the referenced articlepublic void bind(XMLParentArticle article, AnchorElement anchor)
bind in interface ArticleReferencearticle - the referenced articleanchor - the AnchorElementCopyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence