public class XMLReference extends java.lang.Object implements org.docgene.model.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(org.docgene.model.Article article)
Constructor.
|
XMLReference(org.docgene.model.Article article,
java.lang.String rawID,
java.lang.String pack)
Constructor.
|
XMLReference(org.docgene.model.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,
org.docgene.model.AnchorElement anchor)
Set the referenced article and associated chapter or title.
|
org.docgene.model.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.
|
org.docgene.model.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, wait
hasInlinedStyle, setCustomStyles
protected java.lang.String id
protected java.lang.String rawID
protected boolean idMayBeDesc
protected java.lang.String desc
public XMLReference(org.docgene.model.Article article)
article
- the article which emit the referencepublic XMLReference(org.docgene.model.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(org.docgene.model.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 org.docgene.model.ElementReference
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDeclaration()
getDeclaration
in interface StyledElement
public boolean isAutoDesc()
isAutoDesc
in interface org.docgene.model.ArticleReference
public boolean isBareReference()
isBareReference
in interface org.docgene.model.ArticleReference
public void setStyle(java.lang.String style)
style
- the style classpublic java.lang.String getStyle()
getStyle
in interface StyledElement
public void setInlinedStyle(java.lang.String style)
setInlinedStyle
in interface StyledElement
style
- the element custom inline stylepublic java.lang.String getInlinedStyle()
getInlinedStyle
in interface StyledElement
public void setCustomStyles(java.util.Set<java.lang.String> classes)
setCustomStyles
in interface StyledElement
classes
- the custom element classespublic java.util.Set<java.lang.String> getCustomStyles()
getCustomStyles
in interface StyledElement
public void setLowerCase(boolean lowerCase)
lowerCase
- true if the first character of the reference should be kept in lower casepublic org.docgene.model.Article getOriginArticle()
public XMLParentArticle getReferencedArticle()
getReferencedArticle
in interface org.docgene.model.ArticleReference
public boolean isBound()
isBound
in interface org.docgene.model.ArticleReference
public void setDesc(java.lang.String desc)
setDesc
in interface org.docgene.model.ArticleReference
desc
- the reference textpublic java.lang.String getRefID()
XMLArticle.getDescription()
XMLArticle.getID()
getRefID
in interface org.docgene.model.ArticleReference
public java.lang.String getRefPackage()
getRefPackage
in interface org.docgene.model.ArticleReference
protected java.lang.String getDescription(XMLParentArticle article, java.lang.String refID)
article
- the parent articlerefID
- the IDpublic java.lang.String getDesc()
getDesc
in interface org.docgene.model.ArticleReference
public org.docgene.model.AnchorElement getAnchorElement()
getAnchorElement
in interface org.docgene.model.ArticleReference
public ArticleRef getArticleRef()
getArticleRef
in interface org.docgene.model.ArticleReference
public void bind(XMLParentArticle article)
bind
in interface org.docgene.model.ArticleReference
article
- the referenced articlepublic void bind(XMLParentArticle article, org.docgene.model.AnchorElement anchor)
bind
in interface org.docgene.model.ArticleReference
article
- the referenced articleanchor
- the AnchorElementCopyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence