Class PackagePropertiesUnmarshaller
- java.lang.Object
-
- org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller
-
- All Implemented Interfaces:
PartUnmarshaller
public final class PackagePropertiesUnmarshaller extends Object implements PartUnmarshaller
Package properties unmarshaller.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringKEYWORD_CATEGORYprotected static StringKEYWORD_CONTENT_STATUSprotected static StringKEYWORD_CONTENT_TYPEprotected static StringKEYWORD_CREATEDprotected static StringKEYWORD_CREATORprotected static StringKEYWORD_DESCRIPTIONprotected static StringKEYWORD_IDENTIFIERprotected static StringKEYWORD_KEYWORDSprotected static StringKEYWORD_LANGUAGEprotected static StringKEYWORD_LAST_MODIFIED_BYprotected static StringKEYWORD_LAST_PRINTEDprotected static StringKEYWORD_MODIFIEDprotected static StringKEYWORD_REVISIONprotected static StringKEYWORD_SUBJECTprotected static StringKEYWORD_TITLEprotected static StringKEYWORD_VERSION
-
Constructor Summary
Constructors Constructor Description PackagePropertiesUnmarshaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckElementForOPCCompliance(Element el)Check the element for the following OPC compliance rules:PackagePartunmarshall(UnmarshallContext context, InputStream in)Save the content of the package in the stream
-
-
-
Field Detail
-
KEYWORD_CATEGORY
protected static final String KEYWORD_CATEGORY
- See Also:
- Constant Field Values
-
KEYWORD_CONTENT_STATUS
protected static final String KEYWORD_CONTENT_STATUS
- See Also:
- Constant Field Values
-
KEYWORD_CONTENT_TYPE
protected static final String KEYWORD_CONTENT_TYPE
- See Also:
- Constant Field Values
-
KEYWORD_CREATED
protected static final String KEYWORD_CREATED
- See Also:
- Constant Field Values
-
KEYWORD_CREATOR
protected static final String KEYWORD_CREATOR
- See Also:
- Constant Field Values
-
KEYWORD_DESCRIPTION
protected static final String KEYWORD_DESCRIPTION
- See Also:
- Constant Field Values
-
KEYWORD_IDENTIFIER
protected static final String KEYWORD_IDENTIFIER
- See Also:
- Constant Field Values
-
KEYWORD_KEYWORDS
protected static final String KEYWORD_KEYWORDS
- See Also:
- Constant Field Values
-
KEYWORD_LANGUAGE
protected static final String KEYWORD_LANGUAGE
- See Also:
- Constant Field Values
-
KEYWORD_LAST_MODIFIED_BY
protected static final String KEYWORD_LAST_MODIFIED_BY
- See Also:
- Constant Field Values
-
KEYWORD_LAST_PRINTED
protected static final String KEYWORD_LAST_PRINTED
- See Also:
- Constant Field Values
-
KEYWORD_MODIFIED
protected static final String KEYWORD_MODIFIED
- See Also:
- Constant Field Values
-
KEYWORD_REVISION
protected static final String KEYWORD_REVISION
- See Also:
- Constant Field Values
-
KEYWORD_SUBJECT
protected static final String KEYWORD_SUBJECT
- See Also:
- Constant Field Values
-
KEYWORD_TITLE
protected static final String KEYWORD_TITLE
- See Also:
- Constant Field Values
-
KEYWORD_VERSION
protected static final String KEYWORD_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
unmarshall
public PackagePart unmarshall(UnmarshallContext context, InputStream in) throws InvalidFormatException, IOException
Description copied from interface:PartUnmarshallerSave the content of the package in the stream- Specified by:
unmarshallin interfacePartUnmarshallerin- The input stream from which the part will be read.- Returns:
- The part freshly read from the input stream.
- Throws:
InvalidFormatException- If the data can not be interpreted correctlyIOException- if reading from the stream fails
-
checkElementForOPCCompliance
public void checkElementForOPCCompliance(Element el) throws InvalidFormatException
Check the element for the following OPC compliance rules:Rule M4.2: A format consumer shall consider the use of the Markup Compatibility namespace to be an error.
Rule M4.3: Producers shall not create a document element that contains refinements to the Dublin Core elements, except for the two specified in the schema: <dcterms:created> and <dcterms:modified> Consumers shall consider a document element that violates this constraint to be an error.
Rule M4.4: Producers shall not create a document element that contains the xml:lang attribute. Consumers shall consider a document element that violates this constraint to be an error.
Rule M4.5: Producers shall not create a document element that contains the xsi:type attribute, except for a <dcterms:created> or <dcterms:modified> element where the xsi:type attribute shall be present and shall hold the value dcterms:W3CDTF, where dcterms is the namespace prefix of the Dublin Core namespace. Consumers shall consider a document element that violates this constraint to be an error.
- Throws:
InvalidFormatException
-
-