|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.okapi.common.resource.BaseNameable
public class BaseNameable
Implements a nameable resource.
| Field Summary | |
|---|---|
protected Annotations |
annotations
|
protected java.lang.String |
id
|
protected boolean |
isTranslatable
|
protected java.lang.String |
mimeType
|
protected java.lang.String |
name
|
protected boolean |
preserveWS
|
protected java.util.LinkedHashMap<java.lang.String,Property> |
properties
|
protected ISkeleton |
skeleton
|
protected java.util.LinkedHashMap<java.lang.String,Property> |
sourceProperties
|
protected java.lang.String |
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 | |
|---|---|
BaseNameable()
|
|
| Method Summary | ||
|---|---|---|
Property |
createTargetProperty(LocaleId locId,
java.lang.String name,
boolean overwriteExisting,
int creationOptions)
Creates or get a target property based on the corresponding source. |
|
|
getAnnotation(java.lang.Class<A> annotationType)
Gets the annotation object for a given class for this resource. |
|
java.lang.Iterable<IAnnotation> |
getAnnotations()
Gets the iterable list of the annotations for this resource. |
|
java.lang.String |
getId()
Gets the identifier of the resource. |
|
java.lang.String |
getMimeType()
Gets the type of content of this resource. |
|
java.lang.String |
getName()
Gets the name of this resource. |
|
Property |
getProperty(java.lang.String name)
Gets the resource-level property for a given name. |
|
java.util.Set<java.lang.String> |
getPropertyNames()
Gets the names of all the resource-level properties for this resource. |
|
ISkeleton |
getSkeleton()
Gets the skeleton object for this resource. |
|
Property |
getSourceProperty(java.lang.String name)
Gets the source property for a given name. |
|
java.util.Set<java.lang.String> |
getSourcePropertyNames()
Gets the names of all the source properties for this resource. |
|
java.util.Set<LocaleId> |
getTargetLocales()
Gets all the target locales for this resource. |
|
Property |
getTargetProperty(LocaleId locId,
java.lang.String name)
Gets the target property for a given name and target locale. |
|
java.util.Set<java.lang.String> |
getTargetPropertyNames(LocaleId locId)
Gets the names of all the properties for a given target locale in this resource. |
|
java.lang.String |
getType()
Gets the type information associated with this resource. |
|
boolean |
hasProperty(java.lang.String name)
Indicates if a resource-level property exists for a given name. |
|
boolean |
hasSourceProperty(java.lang.String name)
Indicates if a source property exists for a given name. |
|
boolean |
hasTargetProperty(LocaleId locId,
java.lang.String name)
Indicates if a property exists for a given name and target locale. |
|
boolean |
isTranslatable()
Indicates if the content of this resource is translatable. |
|
boolean |
preserveWhitespaces()
Indicates if the white-spaces in the content of this resource should be preserved. |
|
void |
removeProperty(java.lang.String name)
Removes a resource-level property of a given name. |
|
void |
removeSourceProperty(java.lang.String name)
Removes a source property of a given name. |
|
void |
removeTargetProperty(LocaleId locId,
java.lang.String name)
Removes a target property of a given name. |
|
void |
setAnnotation(IAnnotation annotation)
Sets an annotation object for this resource. |
|
void |
setId(java.lang.String id)
Sets the identifier of this resource. |
|
void |
setIsTranslatable(boolean value)
Sets the flag indicating if the content of this resource is translatable. |
|
void |
setMimeType(java.lang.String value)
Sets the type of content of this resource. |
|
void |
setName(java.lang.String value)
Sets the name of this resource. |
|
void |
setPreserveWhitespaces(boolean value)
sets the flag indicating if the white-spaces in the content of this resource should be preserved. |
|
Property |
setProperty(Property property)
Sets a resource-level property. |
|
void |
setSkeleton(ISkeleton skeleton)
Sets the skeleton object for this resource. |
|
Property |
setSourceProperty(Property property)
Sets a source property. |
|
Property |
setTargetProperty(LocaleId locId,
Property property)
Sets a target property. |
|
void |
setType(java.lang.String value)
Sets the type information associated with this resource. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String id
protected ISkeleton skeleton
protected java.lang.String name
protected java.lang.String type
protected java.lang.String mimeType
protected boolean isTranslatable
protected boolean preserveWS
protected java.util.LinkedHashMap<java.lang.String,Property> properties
protected Annotations annotations
protected java.util.LinkedHashMap<java.lang.String,Property> sourceProperties
| Constructor Detail |
|---|
public BaseNameable()
| Method Detail |
|---|
public java.lang.String getId()
IResource
getId in interface IResourcepublic void setId(java.lang.String id)
IResource
setId in interface IResourceid - the new identifier value.IResource.getId()public ISkeleton getSkeleton()
IResource
getSkeleton in interface IResourcepublic void setSkeleton(ISkeleton skeleton)
IResource
setSkeleton in interface IResourceskeleton - the skeleton object to set.public java.lang.String getName()
INameable
getName in interface INameablepublic void setName(java.lang.String value)
INameable
setName in interface INameablevalue - New name to set.public java.lang.String getType()
INameable
getType in interface INameablepublic void setType(java.lang.String value)
INameable
setType in interface INameablevalue - The new type information.public java.lang.String getMimeType()
INameable
getMimeType in interface INameablepublic void setMimeType(java.lang.String value)
INameable
setMimeType in interface INameablevalue - The new type of content of this resource.public <A extends IAnnotation> A getAnnotation(java.lang.Class<A> annotationType)
IResource
getAnnotation in interface IResourceannotationType - the class of the annotation object to retrieve.
public void setAnnotation(IAnnotation annotation)
IResource
setAnnotation in interface IResourceannotation - the annotation object to set.public Property getProperty(java.lang.String name)
INameable
getProperty in interface INameablename - Name of the property to retrieve.
public Property setProperty(Property property)
INameable
setProperty in interface INameableproperty - The new property to set.
public void removeProperty(java.lang.String name)
INameable
removeProperty in interface INameablename - The name of the property to remove.public java.util.Set<java.lang.String> getPropertyNames()
INameable
getPropertyNames in interface INameablepublic boolean hasProperty(java.lang.String name)
INameable
hasProperty in interface INameablename - The name of the resource-level property to query.
public Property getSourceProperty(java.lang.String name)
INameable
getSourceProperty in interface INameablename - The name of the source property to retrieve.
public Property setSourceProperty(Property property)
INameable
setSourceProperty in interface INameableproperty - The new property to set.
public void removeSourceProperty(java.lang.String name)
INameable
removeSourceProperty in interface INameablename - The name of the property to remove.public java.util.Set<java.lang.String> getSourcePropertyNames()
INameable
getSourcePropertyNames in interface INameablepublic boolean hasSourceProperty(java.lang.String name)
INameable
hasSourceProperty in interface INameablename - The name of the source property to query.
public Property getTargetProperty(LocaleId locId,
java.lang.String name)
INameable
getTargetProperty in interface INameablelocId - the locale of the property to retrieve.name - The name of the property to retrieve. This name is case-sensitive.
public Property setTargetProperty(LocaleId locId,
Property property)
INameable
setTargetProperty in interface INameablelocId - The target locale for which this property should be set.property - The new property to set. This name is case-sensitive.
public java.util.Set<java.lang.String> getTargetPropertyNames(LocaleId locId)
INameable
getTargetPropertyNames in interface INameablelocId - the target locale to query.
public void removeTargetProperty(LocaleId locId,
java.lang.String name)
INameable
removeTargetProperty in interface INameablelocId - The target locale for which this property should be set.name - The name of the property to remove.
public boolean hasTargetProperty(LocaleId locId,
java.lang.String name)
INameable
hasTargetProperty in interface INameablelocId - the target locale to query.name - the name of the property to query.
public java.util.Set<LocaleId> getTargetLocales()
INameable
getTargetLocales in interface INameable
public Property createTargetProperty(LocaleId locId,
java.lang.String name,
boolean overwriteExisting,
int creationOptions)
INameable
createTargetProperty in interface INameablelocId - The target locale to use.name - The name of the property to create (or retrieve)overwriteExisting - True to overwrite any existing property.
False to not create a new property if one exists already.creationOptions - Creation options:
public boolean isTranslatable()
INameable
isTranslatable in interface INameablepublic void setIsTranslatable(boolean value)
INameable
setIsTranslatable in interface INameablevalue - True to indicate that the content of this resource is translatable.public boolean preserveWhitespaces()
INameable
preserveWhitespaces in interface INameablepublic void setPreserveWhitespaces(boolean value)
INameable
setPreserveWhitespaces in interface INameablevalue - True to indicate that the white-spaces in the content of this resource should be preserved.public java.lang.Iterable<IAnnotation> getAnnotations()
IResource
getAnnotations in interface IResource
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||