Module org.sejda.sambox
Class PDStandardAttributeObject
java.lang.Object
org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
org.sejda.sambox.pdmodel.documentinterchange.logicalstructure.PDAttributeObject
org.sejda.sambox.pdmodel.documentinterchange.taggedpdf.PDStandardAttributeObject
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDLayoutAttributeObject,PDListAttributeObject,PDPrintFieldAttributeObject,PDTableAttributeObject
A standard attribute object.
- Author:
- Johannes Koch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final floatAn "unspecified" default float value. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PDStandardAttributeObject(COSDictionary dictionary) Creates a new standard attribute object with a given dictionary. -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]getArrayOfString(String name) Gets an array of strings.protected PDGammaGets a colour.protected ObjectgetColorOrFourColors(String name) Gets a single colour or four colours.protected intgetInteger(String name, int defaultValue) Gets an integer.protected StringGets a name value.protected StringGets a name value.protected ObjectgetNameOrArrayOfName(String name, String defaultValue) Gets a name value or array of name values.protected floatGets a number value.protected floatGets a number value.protected ObjectgetNumberOrArrayOfNumber(String name, float defaultValue) Gets a number or an array of numbers.protected ObjectgetNumberOrName(String name, String defaultValue) Gets a number or a name value.protected StringGets a string attribute value.booleanisSpecified(String name) Is the attribute with the given name specified in this attribute object?protected voidsetArrayOfName(String name, String[] values) Sets an array of name values.protected voidsetArrayOfNumber(String name, float[] values) Sets an array of float numbers.protected voidsetArrayOfString(String name, String[] values) Sets an array of strings.protected voidSets a colour.protected voidsetFourColors(String name, PDFourColours value) Sets four colours.protected voidsetInteger(String name, int value) Sets an integer.protected voidSets a name value.protected voidSets a float number.protected voidSets an integer number.protected voidSets a string attribute value.Methods inherited from class org.sejda.sambox.pdmodel.documentinterchange.logicalstructure.PDAttributeObject
arrayToString, arrayToString, create, getOwner, isEmpty, notifyChanged, potentiallyNotifyChanged, setOwner, setStructureElement, toStringMethods inherited from class org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
Field Details
-
UNSPECIFIED
protected static final float UNSPECIFIEDAn "unspecified" default float value.- See Also:
-
-
Constructor Details
-
PDStandardAttributeObject
public PDStandardAttributeObject()Default constructor. -
PDStandardAttributeObject
Creates a new standard attribute object with a given dictionary.- Parameters:
dictionary- the dictionary
-
-
Method Details
-
isSpecified
Is the attribute with the given name specified in this attribute object?- Parameters:
name- the attribute name- Returns:
trueif the attribute is specified,falseotherwise
-
getString
Gets a string attribute value.- Parameters:
name- the attribute name- Returns:
- the string attribute value
-
setString
Sets a string attribute value.- Parameters:
name- the attribute namevalue- the string attribute value
-
getArrayOfString
Gets an array of strings.- Parameters:
name- the attribute name- Returns:
- the array of strings
-
setArrayOfString
Sets an array of strings.- Parameters:
name- the attribute namevalues- the array of strings
-
getName
Gets a name value.- Parameters:
name- the attribute name- Returns:
- the name value
-
getName
Gets a name value.- Parameters:
name- the attribute namedefaultValue- the default value- Returns:
- the name value
-
getNameOrArrayOfName
Gets a name value or array of name values.- Parameters:
name- the attribute namedefaultValue- the default value- Returns:
- a String or array of Strings
-
setName
Sets a name value.- Parameters:
name- the attribute namevalue- the name value
-
setArrayOfName
Sets an array of name values.- Parameters:
name- the attribute namevalues- the array of name values
-
getNumberOrName
Gets a number or a name value.- Parameters:
name- the attribute namedefaultValue- the default name- Returns:
- a Float or a String
-
getInteger
Gets an integer.- Parameters:
name- the attribute namedefaultValue- the default value- Returns:
- the integer
-
setInteger
Sets an integer.- Parameters:
name- the attribute namevalue- the integer
-
getNumber
Gets a number value.- Parameters:
name- the attribute namedefaultValue- the default value- Returns:
- the number value
-
getNumber
Gets a number value.- Parameters:
name- the attribute name- Returns:
- the number value
-
getNumberOrArrayOfNumber
Gets a number or an array of numbers.- Parameters:
name- the attribute namedefaultValue- the default value- Returns:
- a Float or an array of floats
-
setNumber
Sets a float number.- Parameters:
name- the attribute namevalue- the float number
-
setNumber
Sets an integer number.- Parameters:
name- the attribute namevalue- the integer number
-
setArrayOfNumber
Sets an array of float numbers.- Parameters:
name- the attribute namevalues- the float numbers
-
getColor
Gets a colour.- Parameters:
name- the attribute name- Returns:
- the colour
-
getColorOrFourColors
Gets a single colour or four colours.- Parameters:
name- the attribute name- Returns:
- the single (
PDGamma) or a (PDFourColours)
-
setColor
Sets a colour.- Parameters:
name- the attribute namevalue- the colour
-
setFourColors
Sets four colours.- Parameters:
name- the attribute namevalue- the four colours
-