Class Anchor
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
com.gitlab.pdftk_java.com.lowagie.text.Phrase
com.gitlab.pdftk_java.com.lowagie.text.Anchor
- All Implemented Interfaces:
Element, MarkupAttributes, TextElementArray, Serializable, Cloneable, Iterable, Collection, List, RandomAccess, SequencedCollection
An
Anchor can be a reference or a destination of a reference.
An Anchor is a special kind of Phrase.
It is constructed in the same way.
Example:
Anchor anchor = new Anchor("this is a link");
anchor.setName("LINK");
anchor.setReference("http://www.lowagie.com");
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThis is the anchor tag.protected StringThis is the name of theAnchor.protected StringThis is the reference of theAnchor.private static final longFields inherited from class Phrase
font, leading, markupAttributesFields inherited from class AbstractList
modCountFields inherited from interface Element
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE -
Constructor Summary
ConstructorsConstructorDescriptionAnchor()Constructs anAnchorwithout specifying a leading.Anchor(float leading) Constructs anAnchorwith a certain leading.Constructs anAnchorwith a certainChunkand a certain leading.Constructs anAnchorwith a certain leading and a certainString.Constructs anAnchorwith a certain leading, a certainStringand a certainFont.Constructs anAnchorwith a certainChunk.Constructs anAnchorwith a certainString.Constructs anAnchorwith a certainStringand a certainFont.Anchor(Properties attributes) Returns anAnchorthat has been constructed taking in account the value of some attributes. -
Method Summary
Modifier and TypeMethodDescriptionGets all the chunks in this element.Gets an iterator ofElements.static booleanChecks if a given tag corresponds with this object.name()Returns the name of thisAnchor.booleanprocess(ElementListener listener) Processes the element by adding it (or the different parts) to anElementListener.Gets the reference of thisAnchor.voidSets the name of thisAnchor.voidsetReference(String reference) Sets the reference of thisAnchor.inttype()Gets the type of the text element.url()Gets the reference of thisAnchor.Methods inherited from class Phrase
add, add, addAll, addSpecial, font, getInstance, getInstance, getInstance, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, isEmpty, leading, leadingDefined, setLeading, setMarkupAttribute, setMarkupAttributesMethods inherited from class ArrayList
addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversedMethods inherited from interface MarkupAttributes
getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, setMarkupAttribute, setMarkupAttributesMethods inherited from interface TextElementArray
add
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
ANCHOR
-
name
This is the name of theAnchor. -
reference
This is the reference of theAnchor.
-
-
Constructor Details
-
Anchor
public Anchor()Constructs anAnchorwithout specifying a leading. -
Anchor
public Anchor(float leading) Constructs anAnchorwith a certain leading.- Parameters:
leading- the leading
-
Anchor
-
Anchor
Constructs anAnchorwith a certainString.- Parameters:
string- aString
-
Anchor
-
Anchor
Constructs anAnchorwith a certainChunkand a certain leading.- Parameters:
leading- the leadingchunk- aChunk
-
Anchor
Constructs anAnchorwith a certain leading and a certainString.- Parameters:
leading- the leadingstring- aString
-
Anchor
-
Anchor
Returns anAnchorthat has been constructed taking in account the value of some attributes.- Parameters:
attributes- Some attributes
-
-
Method Details
-
process
Processes the element by adding it (or the different parts) to anElementListener. -
getChunks
-
type
-
getElements
-
setName
-
setReference
Sets the reference of thisAnchor.- Parameters:
reference- a new reference
-
name
-
reference
-
url
-
isTag
Checks if a given tag corresponds with this object.- Parameters:
tag- the given tag- Returns:
- true if the tag corresponds
-