Package com.itextpdf.kernel.xmp.options
Class SerializeOptions
java.lang.Object
com.itextpdf.kernel.xmp.options.Options
com.itextpdf.kernel.xmp.options.SerializeOptions
- Since:
- 24.01.2006
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The number of levels of indentation to be used for the outermost XML element in the serialized RDF.static final int
UTF16BE encodingstatic final int
UTF16LE encodingstatic final int
UTF8 encoding; this is the defaultprivate static final int
static final int
The padding parameter provides the overall packet length.static final int
Include a padding allowance for a thumbnail image.private String
The string to be used for each level of indentation in the serialized RDF.private static final int
Bit indicating little endian encoding, unset is big endianprivate String
The string to be used as a line terminator.static final int
Omit the XML packet wrapper.static final int
Omit the <x:xmpmeta>-tagprivate boolean
Omits the Toolkit version attribute, not published, only used for Unit tests.private int
The amount of padding to be added if a writeable XML packet is created.static final int
Mark packet as read-only.static final int
Sort the struct properties and qualifier before serializingstatic final int
Use the canonical form of RDF if set.static final int
Use a compact form of RDF.private static final int
Bit indication UTF16 encoding. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SerializeOptions
(int options) Constructor using inital options -
Method Summary
Modifier and TypeMethodDescriptionclone()
protected String
defineOptionName
(int option) To be implemeted by inheritants.int
boolean
boolean
boolean
boolean
boolean
boolean
boolean
int
boolean
boolean
getSort()
boolean
boolean
protected int
To be implemeted by inheritants.setBaseIndent
(int baseIndent) setEncodeUTF16BE
(boolean value) setEncodeUTF16LE
(boolean value) setExactPacketLength
(boolean value) setIncludeThumbnailPad
(boolean value) setNewline
(String newline) setOmitPacketWrapper
(boolean value) setOmitXmpMetaElement
(boolean value) setPadding
(int padding) setReadOnlyPacket
(boolean value) setSort
(boolean value) setUseCanonicalFormat
(boolean value) setUseCompactFormat
(boolean value) Methods inherited from class com.itextpdf.kernel.xmp.options.Options
assertConsistency, clear, containsAllOptions, containsOneOf, equals, getOption, getOptions, getOptionsString, hashCode, isExactly, setOption, setOptions, toString
-
Field Details
-
OMIT_PACKET_WRAPPER
public static final int OMIT_PACKET_WRAPPEROmit the XML packet wrapper.- See Also:
-
READONLY_PACKET
public static final int READONLY_PACKETMark packet as read-only. Default is a writeable packet.- See Also:
-
USE_COMPACT_FORMAT
public static final int USE_COMPACT_FORMATUse a compact form of RDF. The compact form is the default serialization format (this flag is technically ignored). To serialize to the canonical form, set the flag USE_CANONICAL_FORMAT. If both flags "compact" and "canonical" are set, canonical is used.- See Also:
-
USE_CANONICAL_FORMAT
public static final int USE_CANONICAL_FORMATUse the canonical form of RDF if set. By default the compact form is used- See Also:
-
INCLUDE_THUMBNAIL_PAD
public static final int INCLUDE_THUMBNAIL_PADInclude a padding allowance for a thumbnail image. If no xmp:Thumbnails property is present, the typical space for a JPEG thumbnail is used.- See Also:
-
EXACT_PACKET_LENGTH
public static final int EXACT_PACKET_LENGTHThe padding parameter provides the overall packet length. The actual amount of padding is computed. An exception is thrown if the packet exceeds this length with no padding.- See Also:
-
OMIT_XMPMETA_ELEMENT
public static final int OMIT_XMPMETA_ELEMENTOmit the <x:xmpmeta>-tag- See Also:
-
SORT
public static final int SORTSort the struct properties and qualifier before serializing- See Also:
-
LITTLEENDIAN_BIT
private static final int LITTLEENDIAN_BITBit indicating little endian encoding, unset is big endian- See Also:
-
UTF16_BIT
private static final int UTF16_BITBit indication UTF16 encoding.- See Also:
-
ENCODE_UTF8
public static final int ENCODE_UTF8UTF8 encoding; this is the default- See Also:
-
ENCODE_UTF16BE
public static final int ENCODE_UTF16BEUTF16BE encoding- See Also:
-
ENCODE_UTF16LE
public static final int ENCODE_UTF16LEUTF16LE encoding- See Also:
-
ENCODING_MASK
private static final int ENCODING_MASK- See Also:
-
padding
private int paddingThe amount of padding to be added if a writeable XML packet is created. If zero is passed (the default) an appropriate amount of padding is computed. -
newline
The string to be used as a line terminator. If empty it defaults to; linefeed, U+000A, the standard XML newline. -
indent
The string to be used for each level of indentation in the serialized RDF. If empty it defaults to two ASCII spaces, U+0020. -
baseIndent
private int baseIndentThe number of levels of indentation to be used for the outermost XML element in the serialized RDF. This is convenient when embedding the RDF in other text, defaults to 0. -
omitVersionAttribute
private boolean omitVersionAttributeOmits the Toolkit version attribute, not published, only used for Unit tests.
-
-
Constructor Details
-
SerializeOptions
public SerializeOptions()Default constructor. -
SerializeOptions
Constructor using inital options- Parameters:
options
- the inital options- Throws:
XMPException
- Thrown if options are not consistant.
-
-
Method Details
-
getOmitPacketWrapper
public boolean getOmitPacketWrapper()- Returns:
- Returns the option.
-
setOmitPacketWrapper
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getOmitXmpMetaElement
public boolean getOmitXmpMetaElement()- Returns:
- Returns the option.
-
setOmitXmpMetaElement
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getReadOnlyPacket
public boolean getReadOnlyPacket()- Returns:
- Returns the option.
-
setReadOnlyPacket
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getUseCompactFormat
public boolean getUseCompactFormat()- Returns:
- Returns the option.
-
setUseCompactFormat
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getUseCanonicalFormat
public boolean getUseCanonicalFormat()- Returns:
- Returns the option.
-
setUseCanonicalFormat
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getIncludeThumbnailPad
public boolean getIncludeThumbnailPad()- Returns:
- Returns the option.
-
setIncludeThumbnailPad
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getExactPacketLength
public boolean getExactPacketLength()- Returns:
- Returns the option.
-
setExactPacketLength
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getSort
public boolean getSort()- Returns:
- Returns the option.
-
setSort
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getEncodeUTF16BE
public boolean getEncodeUTF16BE()- Returns:
- Returns the option.
-
setEncodeUTF16BE
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getEncodeUTF16LE
public boolean getEncodeUTF16LE()- Returns:
- Returns the option.
-
setEncodeUTF16LE
- Parameters:
value
- the value to set- Returns:
- Returns the instance to call more set-methods.
-
getBaseIndent
public int getBaseIndent()- Returns:
- Returns the baseIndent.
-
setBaseIndent
- Parameters:
baseIndent
- The baseIndent to set.- Returns:
- Returns the instance to call more set-methods.
-
getIndent
- Returns:
- Returns the indent.
-
setIndent
- Parameters:
indent
- The indent to set.- Returns:
- Returns the instance to call more set-methods.
-
getNewline
- Returns:
- Returns the newline.
-
setNewline
- Parameters:
newline
- The newline to set.- Returns:
- Returns the instance to call more set-methods.
-
getPadding
public int getPadding()- Returns:
- Returns the padding.
-
setPadding
- Parameters:
padding
- The padding to set.- Returns:
- Returns the instance to call more set-methods.
-
getOmitVersionAttribute
public boolean getOmitVersionAttribute()- Returns:
- Returns whether the Toolkit version attribute shall be omitted. Note: This options can only be set by unit tests.
-
getEncoding
- Returns:
- Returns the encoding as Java encoding String.
-
clone
-
defineOptionName
Description copied from class:Options
To be implemeted by inheritants.- Specified by:
defineOptionName
in classOptions
- Parameters:
option
- a single, valid option bit.- Returns:
- Returns a human readable name for an option bit.
- See Also:
-
getValidOptions
protected int getValidOptions()Description copied from class:Options
To be implemeted by inheritants.- Specified by:
getValidOptions
in classOptions
- Returns:
- Returns a bit mask where all valid option bits are set.
- See Also:
-