public class BaseNameable extends Object implements INameable
| Modifier and Type | Field and Description |
|---|---|
protected Annotations |
annotations |
protected String |
id |
protected boolean |
isTranslatable |
protected String |
mimeType |
protected String |
name |
protected boolean |
preserveWS |
protected LinkedHashMap<String,Property> |
properties |
protected ISkeleton |
skeleton |
protected LinkedHashMap<String,Property> |
sourceProperties |
protected String |
type |
COPY_ALL, COPY_CONTENT, COPY_PROPERTIES, COPY_SEGMENTATION, COPY_SEGMENTED_CONTENT, CREATE_EMPTY| Constructor and Description |
|---|
BaseNameable() |
| Modifier and Type | Method and Description |
|---|---|
Property |
createTargetProperty(LocaleId locId,
String name,
boolean overwriteExisting,
int creationOptions)
Creates or get a target property based on the corresponding source.
|
<A extends IAnnotation> |
getAnnotation(Class<A> annotationType)
Gets the annotation object for a given class for this resource.
|
Iterable<IAnnotation> |
getAnnotations()
Gets the iterable list of the annotations for this resource.
|
String |
getId()
Gets the identifier of the resource.
|
String |
getMimeType()
Gets the type of content of this resource.
|
String |
getName()
Gets the name of this resource.
|
protected LinkedHashMap<String,Property> |
getProperties() |
Property |
getProperty(String name)
Gets the resource-level property for a given name.
|
Set<String> |
getPropertyNames()
Gets the names of all the resource-level properties for this resource.
|
ISkeleton |
getSkeleton()
Gets the skeleton object for this resource.
|
protected LinkedHashMap<String,Property> |
getSourceProperties() |
Property |
getSourceProperty(String name)
Gets the source property for a given name.
|
Set<String> |
getSourcePropertyNames()
Gets the names of all the source properties for this resource.
|
Set<LocaleId> |
getTargetLocales()
Gets all the target locales for this resource.
|
Property |
getTargetProperty(LocaleId locId,
String name)
Gets the target property for a given name and target locale.
|
Set<String> |
getTargetPropertyNames(LocaleId locId)
Gets the names of all the properties for a given target locale in this resource.
|
String |
getType()
Gets the type information associated with this resource.
|
boolean |
hasProperty(String name)
Indicates if a resource-level property exists for a given name.
|
boolean |
hasSourceProperty(String name)
Indicates if a source property exists for a given name.
|
boolean |
hasTargetProperty(LocaleId locId,
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(String name)
Removes a resource-level property of a given name.
|
void |
removeSourceProperty(String name)
Removes a source property of a given name.
|
void |
removeTargetProperty(LocaleId locId,
String name)
Removes a target property of a given name.
|
void |
setAnnotation(IAnnotation annotation)
Sets an annotation object for this resource.
|
void |
setId(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(String value)
Sets the type of content of this resource.
|
void |
setName(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.
|
protected void |
setProperties(LinkedHashMap<String,Property> properties) |
Property |
setProperty(Property property)
Sets a resource-level property.
|
void |
setSkeleton(ISkeleton skeleton)
Sets the skeleton object for this resource.
|
protected void |
setSourceProperties(LinkedHashMap<String,Property> sourceProperties) |
Property |
setSourceProperty(Property property)
Sets a source property.
|
Property |
setTargetProperty(LocaleId locId,
Property property)
Sets a target property.
|
void |
setType(String value)
Sets the type information associated with this resource.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcopycopycopyprotected String id
protected ISkeleton skeleton
protected String name
protected String type
protected String mimeType
protected boolean isTranslatable
protected boolean preserveWS
protected LinkedHashMap<String,Property> properties
protected Annotations annotations
protected LinkedHashMap<String,Property> sourceProperties
public String getId()
IResourcepublic void setId(String id)
IResourcesetId in interface IResourceid - the new identifier value.IResource.getId()public ISkeleton getSkeleton()
IResourcegetSkeleton in interface IResourcepublic void setSkeleton(ISkeleton skeleton)
IResourcesetSkeleton in interface IResourceskeleton - the skeleton object to set.public String getName()
INameablepublic void setName(String value)
INameablepublic String getType()
INameablepublic void setType(String value)
INameablepublic String getMimeType()
INameablegetMimeType in interface INameablepublic void setMimeType(String value)
INameablesetMimeType in interface INameablevalue - The new type of content of this resource.public <A extends IAnnotation> A getAnnotation(Class<A> annotationType)
IWithAnnotationsgetAnnotation in interface IWithAnnotationsA - the type of the class.annotationType - the class of the annotation object to retrieve.public void setAnnotation(IAnnotation annotation)
IWithAnnotationssetAnnotation in interface IWithAnnotationsannotation - the annotation object to set.public Property getProperty(String name)
IWithPropertiesgetProperty in interface IWithPropertiesname - Name of the property to retrieve.public Property setProperty(Property property)
IWithPropertiessetProperty in interface IWithPropertiesproperty - The new property to set.public void removeProperty(String name)
IWithPropertiesremoveProperty in interface IWithPropertiesname - The name of the property to remove.public Set<String> getPropertyNames()
IWithPropertiesgetPropertyNames in interface IWithPropertiespublic boolean hasProperty(String name)
IWithPropertieshasProperty in interface IWithPropertiesname - The name of the resource-level property to query.public Property getSourceProperty(String name)
IWithBilingualPropertiesgetSourceProperty in interface IWithBilingualPropertiesname - The name of the source property to retrieve.public Property setSourceProperty(Property property)
IWithBilingualPropertiessetSourceProperty in interface IWithBilingualPropertiesproperty - The new property to set.public void removeSourceProperty(String name)
IWithBilingualPropertiesremoveSourceProperty in interface IWithBilingualPropertiesname - The name of the property to remove.public Set<String> getSourcePropertyNames()
IWithBilingualPropertiesgetSourcePropertyNames in interface IWithBilingualPropertiespublic boolean hasSourceProperty(String name)
IWithBilingualPropertieshasSourceProperty in interface IWithBilingualPropertiesname - The name of the source property to query.public Property getTargetProperty(LocaleId locId, String name)
IWithBilingualPropertiesgetTargetProperty in interface IWithBilingualPropertieslocId - 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)
IWithBilingualPropertiessetTargetProperty in interface IWithBilingualPropertieslocId - The target locale for which this property should be set.property - The new property to set. This name is case-sensitive.public Set<String> getTargetPropertyNames(LocaleId locId)
IWithBilingualPropertiesgetTargetPropertyNames in interface IWithBilingualPropertieslocId - the target locale to query.public void removeTargetProperty(LocaleId locId, String name)
IWithBilingualPropertiesremoveTargetProperty in interface IWithBilingualPropertieslocId - The target locale for which this property should be set.name - The name of the property to remove.public boolean hasTargetProperty(LocaleId locId, String name)
IWithBilingualPropertieshasTargetProperty in interface IWithBilingualPropertieslocId - the target locale to query.name - the name of the property to query.public Set<LocaleId> getTargetLocales()
IWithBilingualPropertiesgetTargetLocales in interface IWithBilingualPropertiespublic Property createTargetProperty(LocaleId locId, String name, boolean overwriteExisting, int creationOptions)
INameablecreateTargetProperty 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()
INameableisTranslatable in interface INameablepublic void setIsTranslatable(boolean value)
INameablesetIsTranslatable in interface INameablevalue - True to indicate that the content of this resource is translatable.public boolean preserveWhitespaces()
INameablepreserveWhitespaces in interface INameablepublic void setPreserveWhitespaces(boolean value)
INameablesetPreserveWhitespaces in interface INameablevalue - True to indicate that the white-spaces in the content of this resource should be preserved.public Iterable<IAnnotation> getAnnotations()
IWithAnnotationsgetAnnotations in interface IWithAnnotationsprotected LinkedHashMap<String,Property> getProperties()
protected void setProperties(LinkedHashMap<String,Property> properties)
protected LinkedHashMap<String,Property> getSourceProperties()
protected void setSourceProperties(LinkedHashMap<String,Property> sourceProperties)
Copyright © 2021. All rights reserved.