Class DefaultAccessibilityProperties
- java.lang.Object
-
- com.itextpdf.kernel.pdf.tagutils.AccessibilityProperties
-
- com.itextpdf.kernel.pdf.tagutils.DefaultAccessibilityProperties
-
- Direct Known Subclasses:
FormDefaultAccessibilityProperties
public class DefaultAccessibilityProperties extends AccessibilityProperties
The class represents a basic implementation ofAccessibilityProperties
that preserves specified accessibility properties. Accessibility properties are used to define properties ofstructure elements
in Tagged PDF documents viaTagTreePointer
API.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
actualText
protected java.lang.String
alternateDescription
protected java.util.List<PdfStructureAttributes>
attributesList
protected java.lang.String
expansion
protected java.lang.String
language
protected PdfNamespace
namespace
protected java.lang.String
phoneme
protected java.lang.String
phoneticAlphabet
protected java.util.List<TagTreePointer>
refs
protected java.lang.String
role
private byte[]
structElemId
-
Constructor Summary
Constructors Constructor Description DefaultAccessibilityProperties(java.lang.String role)
Instantiates a newDefaultAccessibilityProperties
instance based on structure element role.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessibilityProperties
addAttributes(int index, PdfStructureAttributes attributes)
Adds the attributes to the element with specified index.AccessibilityProperties
addAttributes(PdfStructureAttributes attributes)
Adds the attributes to the element.AccessibilityProperties
addRef(TagTreePointer treePointer)
Adds the reference to other tagged element.AccessibilityProperties
clearAttributes()
Clears the list of attributes.AccessibilityProperties
clearRefs()
Clears the list of references to other tagged elements.java.lang.String
getActualText()
Gets the actual text of element.java.lang.String
getAlternateDescription()
Gets the alternate description of element.java.util.List<PdfStructureAttributes>
getAttributesList()
Gets the attributes list.java.lang.String
getExpansion()
Gets the expansion of element.java.lang.String
getLanguage()
Gets the language identifier of element.PdfNamespace
getNamespace()
Gets the namespace of element.java.lang.String
getPhoneme()
Gets the phoneme of element.java.lang.String
getPhoneticAlphabet()
Gets the phonetic alphabet of element.java.util.List<TagTreePointer>
getRefsList()
Gets the list of references to other tagged elements.java.lang.String
getRole()
Gets the role of element.byte[]
getStructureElementId()
Gets the associated structure element's ID string, if it has one.AccessibilityProperties
setActualText(java.lang.String actualText)
Sets the actual text of element.AccessibilityProperties
setAlternateDescription(java.lang.String alternateDescription)
Sets the alternate description of element.AccessibilityProperties
setExpansion(java.lang.String expansion)
Sets the expansion of element.AccessibilityProperties
setLanguage(java.lang.String language)
Sets the language identifier of element.AccessibilityProperties
setNamespace(PdfNamespace namespace)
Sets the namespace of element.AccessibilityProperties
setPhoneme(java.lang.String phoneme)
Sets the phoneme of element.AccessibilityProperties
setPhoneticAlphabet(java.lang.String phoneticAlphabet)
Sets the phonetic alphabet of element.AccessibilityProperties
setRole(java.lang.String role)
Sets the role of element.AccessibilityProperties
setStructureElementId(byte[] id)
Sets the associated structure element's ID.-
Methods inherited from class com.itextpdf.kernel.pdf.tagutils.AccessibilityProperties
setStructureElementIdString
-
-
-
-
Field Detail
-
role
protected java.lang.String role
-
language
protected java.lang.String language
-
actualText
protected java.lang.String actualText
-
alternateDescription
protected java.lang.String alternateDescription
-
expansion
protected java.lang.String expansion
-
attributesList
protected java.util.List<PdfStructureAttributes> attributesList
-
phoneme
protected java.lang.String phoneme
-
phoneticAlphabet
protected java.lang.String phoneticAlphabet
-
namespace
protected PdfNamespace namespace
-
refs
protected java.util.List<TagTreePointer> refs
-
structElemId
private byte[] structElemId
-
-
Constructor Detail
-
DefaultAccessibilityProperties
public DefaultAccessibilityProperties(java.lang.String role)
Instantiates a newDefaultAccessibilityProperties
instance based on structure element role.- Parameters:
role
- the structure element role
-
-
Method Detail
-
getRole
public java.lang.String getRole()
Description copied from class:AccessibilityProperties
Gets the role of element.See also
StandardRoles
.- Overrides:
getRole
in classAccessibilityProperties
- Returns:
- the role
-
setRole
public AccessibilityProperties setRole(java.lang.String role)
Description copied from class:AccessibilityProperties
Sets the role of element.See also
StandardRoles
.Calling this method with a null argument will make the tagging on the associated layout element "neutral". The effect is that all children of the layout element will be tagged as if they were direct children of the parent element.
- Overrides:
setRole
in classAccessibilityProperties
- Parameters:
role
- the role to be set- Returns:
- this
AccessibilityProperties
instance
-
getLanguage
public java.lang.String getLanguage()
Description copied from class:AccessibilityProperties
Gets the language identifier of element. Should be in format xy-ZK (for example en-US).For more information see PDF Specification ISO 32000-1 section 14.9.2.
- Overrides:
getLanguage
in classAccessibilityProperties
- Returns:
- the language
-
setLanguage
public AccessibilityProperties setLanguage(java.lang.String language)
Description copied from class:AccessibilityProperties
Sets the language identifier of element. Should be in format xy-ZK (for example en-US).For more information see PDF Specification ISO 32000-1 section 14.9.2.
- Overrides:
setLanguage
in classAccessibilityProperties
- Parameters:
language
- the language to be set- Returns:
- this
AccessibilityProperties
instance
-
getActualText
public java.lang.String getActualText()
Description copied from class:AccessibilityProperties
Gets the actual text of element.- Overrides:
getActualText
in classAccessibilityProperties
- Returns:
- the actual text
-
setActualText
public AccessibilityProperties setActualText(java.lang.String actualText)
Description copied from class:AccessibilityProperties
Sets the actual text of element.- Overrides:
setActualText
in classAccessibilityProperties
- Parameters:
actualText
- the actual text to be set- Returns:
- this
AccessibilityProperties
instance
-
getAlternateDescription
public java.lang.String getAlternateDescription()
Description copied from class:AccessibilityProperties
Gets the alternate description of element.- Overrides:
getAlternateDescription
in classAccessibilityProperties
- Returns:
- the alternate description
-
setAlternateDescription
public AccessibilityProperties setAlternateDescription(java.lang.String alternateDescription)
Description copied from class:AccessibilityProperties
Sets the alternate description of element.- Overrides:
setAlternateDescription
in classAccessibilityProperties
- Parameters:
alternateDescription
- the alternation description to be set- Returns:
- this
AccessibilityProperties
instance
-
getExpansion
public java.lang.String getExpansion()
Description copied from class:AccessibilityProperties
Gets the expansion of element.Expansion it is the expanded form of an abbreviation of structure element.
- Overrides:
getExpansion
in classAccessibilityProperties
- Returns:
- the expansion
-
setExpansion
public AccessibilityProperties setExpansion(java.lang.String expansion)
Description copied from class:AccessibilityProperties
Sets the expansion of element.Expansion it is the expanded form of an abbreviation of structure element.
- Overrides:
setExpansion
in classAccessibilityProperties
- Parameters:
expansion
- the expansion to be set- Returns:
- this
AccessibilityProperties
instance
-
addAttributes
public AccessibilityProperties addAttributes(PdfStructureAttributes attributes)
Description copied from class:AccessibilityProperties
Adds the attributes to the element.- Overrides:
addAttributes
in classAccessibilityProperties
- Parameters:
attributes
- the attributes to be added- Returns:
- this
AccessibilityProperties
instance
-
addAttributes
public AccessibilityProperties addAttributes(int index, PdfStructureAttributes attributes)
Description copied from class:AccessibilityProperties
Adds the attributes to the element with specified index.If an attribute with the same O and NS entries is specified more than once, the later (in array order) entry shall take precedence. For more information see PDF Specification ISO-32000 section 14.7.6.
- Overrides:
addAttributes
in classAccessibilityProperties
- Parameters:
index
- the attributes indexattributes
- the attributes to be added- Returns:
- this
AccessibilityProperties
instance
-
clearAttributes
public AccessibilityProperties clearAttributes()
Description copied from class:AccessibilityProperties
Clears the list of attributes.- Overrides:
clearAttributes
in classAccessibilityProperties
- Returns:
- this
AccessibilityProperties
instance
-
getAttributesList
public java.util.List<PdfStructureAttributes> getAttributesList()
Description copied from class:AccessibilityProperties
Gets the attributes list.- Overrides:
getAttributesList
in classAccessibilityProperties
- Returns:
- the attributes list
-
getPhoneme
public java.lang.String getPhoneme()
Description copied from class:AccessibilityProperties
Gets the phoneme of element.For more information see
PdfStructElem.setPhoneme(PdfString)
.- Overrides:
getPhoneme
in classAccessibilityProperties
- Returns:
- the phoneme
-
setPhoneme
public AccessibilityProperties setPhoneme(java.lang.String phoneme)
Description copied from class:AccessibilityProperties
Sets the phoneme of element.For more information see
PdfStructElem.setPhoneme(PdfString)
.- Overrides:
setPhoneme
in classAccessibilityProperties
- Parameters:
phoneme
- the phoneme to be set- Returns:
- this
AccessibilityProperties
instance
-
getPhoneticAlphabet
public java.lang.String getPhoneticAlphabet()
Description copied from class:AccessibilityProperties
Gets the phonetic alphabet of element.For more information see
PdfStructElem.setPhoneticAlphabet(PdfName)
.- Overrides:
getPhoneticAlphabet
in classAccessibilityProperties
- Returns:
- the phonetic alphabet
-
setPhoneticAlphabet
public AccessibilityProperties setPhoneticAlphabet(java.lang.String phoneticAlphabet)
Description copied from class:AccessibilityProperties
Sets the phonetic alphabet of element.For more information see
PdfStructElem.setPhoneticAlphabet(PdfName)
.- Overrides:
setPhoneticAlphabet
in classAccessibilityProperties
- Parameters:
phoneticAlphabet
- the phonetic alphabet to be set- Returns:
- this
AccessibilityProperties
instance
-
getNamespace
public PdfNamespace getNamespace()
Description copied from class:AccessibilityProperties
Gets the namespace of element.- Overrides:
getNamespace
in classAccessibilityProperties
- Returns:
- the namespace
-
setNamespace
public AccessibilityProperties setNamespace(PdfNamespace namespace)
Description copied from class:AccessibilityProperties
Sets the namespace of element.- Overrides:
setNamespace
in classAccessibilityProperties
- Parameters:
namespace
- the namespace to be set- Returns:
- this
AccessibilityProperties
instance
-
addRef
public AccessibilityProperties addRef(TagTreePointer treePointer)
Description copied from class:AccessibilityProperties
Adds the reference to other tagged element.For more information see
PdfStructElem.addRef(PdfStructElem)
.- Overrides:
addRef
in classAccessibilityProperties
- Parameters:
treePointer
- the reference to be set- Returns:
- this
AccessibilityProperties
instance
-
getRefsList
public java.util.List<TagTreePointer> getRefsList()
Description copied from class:AccessibilityProperties
Gets the list of references to other tagged elements.For more information see
PdfStructElem.addRef(PdfStructElem)
.- Overrides:
getRefsList
in classAccessibilityProperties
- Returns:
- the list of references
-
clearRefs
public AccessibilityProperties clearRefs()
Description copied from class:AccessibilityProperties
Clears the list of references to other tagged elements.For more information see
PdfStructElem.addRef(PdfStructElem)
.- Overrides:
clearRefs
in classAccessibilityProperties
- Returns:
- this
AccessibilityProperties
instance
-
getStructureElementId
public byte[] getStructureElementId()
Gets the associated structure element's ID string, if it has one.See also
PdfStructElem.getStructureElementId()
.- Overrides:
getStructureElementId
in classAccessibilityProperties
- Returns:
- the structure element's ID string, or null if there is none
-
setStructureElementId
public AccessibilityProperties setStructureElementId(byte[] id)
Sets the associated structure element's ID. Passingnull
removes the ID.- Overrides:
setStructureElementId
in classAccessibilityProperties
- Parameters:
id
- the element's ID to be set- Returns:
- this
AccessibilityProperties
instance
-
-