Package org.opencms.staticexport
Class CmsLinkTable
- java.lang.Object
-
- org.opencms.staticexport.CmsLinkTable
-
public class CmsLinkTable extends java.lang.Object
Maintains a table of links for an element of a CmsXmlPage.- Since:
- 6.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsLinkTable.LinkKeyComparator
Comparator used to deterministically order the link table.
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.Pattern
LINK_PATTERN
Pattern used to extract the index and the part before the index from a link id.
-
Constructor Summary
Constructors Constructor Description CmsLinkTable()
Creates a new CmsLinkTable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsLink
addLink(CmsLink link)
Adds a new link with a given internal name and internal flag to the link table.CmsLink
addLink(CmsRelationType type, java.lang.String targetUri, boolean internal)
Adds a new link to the link table.CmsLink
getLink(java.lang.String name)
Returns the CmsLink Entry for a given name.boolean
isEmpty()
Returns if the link table is empty.java.util.Iterator<CmsLink>
iterator()
Returns an iterator over the links in the table.int
size()
Returns the size of this link table.
-
-
-
Field Detail
-
LINK_PATTERN
public static final java.util.regex.Pattern LINK_PATTERN
Pattern used to extract the index and the part before the index from a link id.
-
-
Constructor Detail
-
CmsLinkTable
public CmsLinkTable()
Creates a new CmsLinkTable.
-
-
Method Detail
-
addLink
public CmsLink addLink(CmsLink link)
Adds a new link with a given internal name and internal flag to the link table.- Parameters:
link
- theCmsLink
to add- Returns:
- the new link entry
-
addLink
public CmsLink addLink(CmsRelationType type, java.lang.String targetUri, boolean internal)
Adds a new link to the link table.- Parameters:
type
- type of the linktargetUri
- link destinationinternal
- flag to indicate if the link is a local link- Returns:
- the new link entry
-
getLink
public CmsLink getLink(java.lang.String name)
Returns the CmsLink Entry for a given name.- Parameters:
name
- the internal name of the link- Returns:
- the CmsLink entry
-
isEmpty
public boolean isEmpty()
Returns if the link table is empty.- Returns:
- true if the link table is empty, false otherwise
-
iterator
public java.util.Iterator<CmsLink> iterator()
Returns an iterator over the links in the table.The objects iterated are of type
.CmsLink
- Returns:
- a string iterator for internal link names
-
size
public int size()
Returns the size of this link table.- Returns:
- the size of this link table
-
-