Class PipelineContentImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v1.content.pipeline.PipelineContentImpl
-
- All Implemented Interfaces:
PipelineContent
public class PipelineContentImpl extends Object implements PipelineContent
-
-
Field Summary
Fields Modifier and Type Field Description protected InputStream
_contentStream
content as input streamprotected org.dom4j.Document
_document
content as documentprotected String
_encoding
content encodingprotected String
_id
content idprotected Map<String,String>
_properties
content propertiesprotected boolean
_xml
is this XML content?static org.slf4j.Logger
logger
-
Fields inherited from interface org.craftercms.studio.api.v1.content.pipeline.PipelineContent
KEY_CONTENT_TYPE, KEY_FILE_NAME, KEY_PATH, KEY_SITE
-
-
Constructor Summary
Constructors Constructor Description PipelineContentImpl()
constructorPipelineContentImpl(String id, InputStream contentStream, boolean isXml, org.dom4j.Document document, String encoding, Map<String,String> properties)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(String key, String value)
add a content propertyvoid
closeContentStream()
close this contentInputStream
getContentStream()
get this content as input streamorg.dom4j.Document
getDocument()
get this content as XML DocumentString
getEncoding()
get the encoding of this contentString
getId()
get the id of this contentMap<String,String>
getProperties()
get properties of this contentString
getProperty(String key)
get a property value given the keyvoid
setContentStream(InputStream contentStream)
set content input stream.this will reset document.void
setDocument(org.dom4j.Document document)
set the content document.void
setEncoding(String encoding)
set the encoding of this contentvoid
setId(String id)
set the id of this contentvoid
setProperties(Map<String,String> properties)
set content properties
-
-
-
Field Detail
-
_id
protected String _id
content id
-
_document
protected org.dom4j.Document _document
content as document
-
_contentStream
protected InputStream _contentStream
content as input stream
-
_encoding
protected String _encoding
content encoding
-
_xml
protected boolean _xml
is this XML content?
-
logger
public static final org.slf4j.Logger logger
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:PipelineContent
get the id of this content- Specified by:
getId
in interfacePipelineContent
- Returns:
- id
-
setId
public void setId(String id)
Description copied from interface:PipelineContent
set the id of this content- Specified by:
setId
in interfacePipelineContent
-
getContentStream
public InputStream getContentStream() throws ContentProcessException
Description copied from interface:PipelineContent
get this content as input stream- Specified by:
getContentStream
in interfacePipelineContent
- Returns:
- input stream
- Throws:
ContentProcessException
-
setContentStream
public void setContentStream(InputStream contentStream)
Description copied from interface:PipelineContent
set content input stream.this will reset document.- Specified by:
setContentStream
in interfacePipelineContent
-
getDocument
public org.dom4j.Document getDocument() throws ContentProcessException
Description copied from interface:PipelineContent
get this content as XML Document- Specified by:
getDocument
in interfacePipelineContent
- Returns:
- document
- Throws:
ContentProcessException
-
setDocument
public void setDocument(org.dom4j.Document document)
Description copied from interface:PipelineContent
set the content document. this will reset content stream- Specified by:
setDocument
in interfacePipelineContent
-
getEncoding
public String getEncoding()
Description copied from interface:PipelineContent
get the encoding of this content- Specified by:
getEncoding
in interfacePipelineContent
- Returns:
- encoding
-
setEncoding
public void setEncoding(String encoding)
Description copied from interface:PipelineContent
set the encoding of this content- Specified by:
setEncoding
in interfacePipelineContent
-
getProperties
public Map<String,String> getProperties()
Description copied from interface:PipelineContent
get properties of this content- Specified by:
getProperties
in interfacePipelineContent
- Returns:
- properties
-
setProperties
public void setProperties(Map<String,String> properties)
Description copied from interface:PipelineContent
set content properties- Specified by:
setProperties
in interfacePipelineContent
-
addProperty
public void addProperty(String key, String value)
Description copied from interface:PipelineContent
add a content property- Specified by:
addProperty
in interfacePipelineContent
-
getProperty
public String getProperty(String key)
Description copied from interface:PipelineContent
get a property value given the key- Specified by:
getProperty
in interfacePipelineContent
- Returns:
- property value
-
closeContentStream
public void closeContentStream()
Description copied from interface:PipelineContent
close this content- Specified by:
closeContentStream
in interfacePipelineContent
-
-