Package net.sf.okapi.common.resource
Class StartDocument
- java.lang.Object
-
- net.sf.okapi.common.resource.BaseNameable
-
- net.sf.okapi.common.resource.StartDocument
-
- All Implemented Interfaces:
Cloneable
,IResource
,IMultilingual
,INameable
,IWithAnnotations
,IWithProperties
,IWithSkeleton
,IWithSourceProperties
,IWithTargetProperties
public class StartDocument extends BaseNameable implements IMultilingual
Resource associated with the filter event START_DOCUMENT.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
encoding
protected String
filterId
protected IFilterWriter
filterWriter
protected boolean
hasUTF8BOM
protected boolean
isMultilingual
protected String
lineBreak
protected LocaleId
locale
protected IParameters
params
-
Fields inherited from class net.sf.okapi.common.resource.BaseNameable
id, isTranslatable, mimeType, name, preserveWS, type
-
Fields inherited from interface net.sf.okapi.common.IResource
COPY_ALL, COPY_CONTENT, COPY_PROPERTIES, COPY_SEGMENTATION, COPY_SEGMENTED_CONTENT, CREATE_EMPTY
-
-
Constructor Summary
Constructors Constructor Description StartDocument()
StartDocument(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEncoding()
Gets the character set encoding of this document.String
getFilterId()
Gets the current filter id for this document.IParameters
getFilterParameters()
Gets the current filter parameters for this document.IFilterWriter
getFilterWriter()
Gets the filter writer for this document.String
getLineBreak()
Gets the type of line-break used in the original document.LocaleId
getLocale()
Gets the locale of this document.Map<String,Property>
getSourceProperties()
boolean
hasUTF8BOM()
Indicates if this document is encoded as UTF8 and has a Byte-Order-Mark.protected boolean
isHasUTF8BOM()
boolean
isMultilingual()
Indicates if this document is multilingual.protected void
setEncoding(String encoding)
void
setEncoding(String encoding, boolean hasUTF8BOM)
Sets the character set encoding of this document.void
setFilterId(String filterId)
Sets the filter id for this document.void
setFilterParameters(IParameters params)
Sets the filter parameters for this document.void
setFilterWriter(IFilterWriter filterWriter)
Sets the filter writer for this document.void
setLineBreak(String value)
Sets the type of line-break used in the original document.void
setLocale(LocaleId locale)
Sets the locale of the document.void
setMultilingual(boolean value)
Sets the flag that indicates if this document is multilingual.-
Methods inherited from class net.sf.okapi.common.resource.BaseNameable
getAnnotation, getAnnotations, getId, getMimeType, getName, getProperties, getProperty, getPropertyNames, getSkeleton, getType, hasProperty, isTranslatable, preserveWhitespaces, removeProperty, setAnnotation, setId, setIsTranslatable, setMimeType, setName, setPreserveWhitespaces, setProperty, setSkeleton, setType, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.okapi.common.resource.INameable
getMimeType, getName, getType, isTranslatable, preserveWhitespaces, setIsTranslatable, setMimeType, setName, setPreserveWhitespaces, setType
-
Methods inherited from interface net.sf.okapi.common.resource.IWithAnnotations
annotationIterator, clear, getAnnotation, getAnnotations, getAnnotationsTypesAsSet, hasAnnotation, hasAnnotations, remove, setAnnotation
-
Methods inherited from interface net.sf.okapi.common.resource.IWithProperties
getProperties, getProperty, getPropertyNames, hasProperty, propertyIterator, removeProperty, setProperty
-
Methods inherited from interface net.sf.okapi.common.resource.IWithSkeleton
getSkeleton, setSkeleton
-
Methods inherited from interface net.sf.okapi.common.resource.IWithSourceProperties
getSourceProperty, getSourcePropertyNames, hasSourceProperty, removeSourceProperty, setSourceProperty
-
Methods inherited from interface net.sf.okapi.common.resource.IWithTargetProperties
createTargetProperty, createTargetProperty, getAnnotations, getTargetLocales, getTargetProperties, getTargetProperty, getTargetPropertyNames, hasTargetProperty, removeTargetProperty, setTargetProperty
-
-
-
-
Field Detail
-
locale
protected LocaleId locale
-
encoding
protected String encoding
-
isMultilingual
protected boolean isMultilingual
-
filterId
protected String filterId
-
params
protected IParameters params
-
filterWriter
protected IFilterWriter filterWriter
-
hasUTF8BOM
protected boolean hasUTF8BOM
-
lineBreak
protected String lineBreak
-
-
Constructor Detail
-
StartDocument
public StartDocument()
-
StartDocument
public StartDocument(String id)
-
-
Method Detail
-
getLocale
public LocaleId getLocale()
Gets the locale of this document. If the document is multilingual this is the source locale.- Returns:
- the (source) locale of the document.
-
setLocale
public void setLocale(LocaleId locale)
Sets the locale of the document. If the document is multilingual this is the source locale.- Parameters:
locale
- (source) locale of the document.
-
getEncoding
public String getEncoding()
Gets the character set encoding of this document. For example "UTF-8"- Returns:
- the string identifying the character set of this document.
-
setEncoding
public void setEncoding(String encoding, boolean hasUTF8BOM)
Sets the character set encoding of this document.- Parameters:
encoding
- The string identifying the character set encoding of this document. For example "UTF-8".hasUTF8BOM
- true if this document is UTf-8 and has a Byte-Order-Mark. False in all other cases.
-
isMultilingual
public boolean isMultilingual()
Indicates if this document is multilingual.- Returns:
- true if this document is multilingual, false otherwise.
-
setMultilingual
public void setMultilingual(boolean value)
Sets the flag that indicates if this document is multilingual.- Parameters:
value
- true to set this document as multilingual, false to set it as monolingual.
-
hasUTF8BOM
public boolean hasUTF8BOM()
Indicates if this document is encoded as UTF8 and has a Byte-Order-Mark.- Returns:
- true if this document is encoded as UTF8 and has a Byte-Order-Mark. False if the document is not encoded in UTF-8 or if if it is encoded in UTF-8 and has not a Byte-Order-Mark.
-
getLineBreak
public String getLineBreak()
Gets the type of line-break used in the original document.- Returns:
- the type of line-break used in the original document.
-
setLineBreak
public void setLineBreak(String value)
Sets the type of line-break used in the original document.- Parameters:
value
- the type of line-break of the original document, for example: "\r\n" (for Windows/DOS line-break).
-
getFilterWriter
public IFilterWriter getFilterWriter()
Gets the filter writer for this document.- Returns:
- the filter writer for this document.
-
setFilterWriter
public void setFilterWriter(IFilterWriter filterWriter)
Sets the filter writer for this document.- Parameters:
filterWriter
- the filter writer for this document.
-
getFilterId
public String getFilterId()
Gets the current filter id for this document.- Returns:
- the filter id for this document.
-
setFilterId
public void setFilterId(String filterId)
Sets the filter id for this document.- Parameters:
filterId
- the object containing the filter id for this document.
-
getFilterParameters
public IParameters getFilterParameters()
Gets the current filter parameters for this document.- Returns:
- the object containing the parameters for this document.
-
setFilterParameters
public void setFilterParameters(IParameters params)
Sets the filter parameters for this document.- Parameters:
params
- the object containing the parameters for this document.
-
isHasUTF8BOM
protected boolean isHasUTF8BOM()
-
setEncoding
protected void setEncoding(String encoding)
-
getSourceProperties
public Map<String,Property> getSourceProperties()
- Specified by:
getSourceProperties
in interfaceIWithSourceProperties
- Returns:
Map
of source properties for the implementer of interface
-
-