Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ru.gammalabs.ice.publishing
Class HTMLStringIF  view HTMLStringIF download HTMLStringIF.java

java.lang.Object
  extended byru.gammalabs.ice.publishing.AbstractIF
      extended byru.gammalabs.ice.publishing.HTMLStringIF
All Implemented Interfaces:
java.lang.Cloneable

public class HTMLStringIF
extends AbstractIF

The holder for values of fields suchs as "content", where the text or converted RTF file is stored


Field Summary
private  java.util.Map values
          Map where keys is Locale locales and values is IEBody strings.
 
Constructor Summary
HTMLStringIF()
          Empty constructor
 
Method Summary
 java.lang.Object clone()
          Clone this object.
 boolean equalsTo(AbstractIF obj)
          Compare this object to another HTMLStringIF object.
 boolean equalsTo(AbstractIF obj, java.util.Locale locale)
          Compare this object to another HTMLStringIF object.
 java.util.Set getAvailableLocales()
          Returns set of all locales where value of this object is definied.
 java.lang.String getValue(java.util.Locale locale)
          Returns string representing multi language html string in locale locale.
 IEBody getValueBody(java.util.Locale locale)
          Returns object IEBody in locale locale.
 long getValueMaxLength(java.util.Locale locale)
          Returns maximum length of html body text defined in locale locale.
 boolean isNullValue(java.util.Locale locale)
          Returns true if html body text in locale locale is null or empty.
 void merge(HTMLStringIF str)
          Add values in MLString str to this string, if there is no locale in this object, add locale and its value from str, if there is locale in this object, replace value of this locale from str.
 void setValue(IEBody body, java.util.Locale locale)
          Sets value of multi language string from object IEBody in locale locale.
 void setValue(java.lang.String str, java.util.Locale locale)
          Sets value of multi language string from string str in locale locale.
 HTMLStringIF switchToHtml(java.util.Locale locale)
          Creates the new field value in HTML mode in locale locale based on current field value.
 HTMLStringIF switchToPlainText(java.util.Locale locale)
          Creates the new field value in plain text mode in locale locale based on current field value.
 HTMLStringIF switchToRTF(java.util.Locale locale)
          Creates the new field value in rtf mode in locale locale based on current field value.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class ru.gammalabs.ice.publishing.AbstractIF
getValue, setValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

values

private java.util.Map values
Map where keys is Locale locales and values is IEBody strings.

Constructor Detail

HTMLStringIF

public HTMLStringIF()
Empty constructor

Method Detail

switchToRTF

public HTMLStringIF switchToRTF(java.util.Locale locale)
Creates the new field value in rtf mode in locale locale based on current field value.


switchToPlainText

public HTMLStringIF switchToPlainText(java.util.Locale locale)
Creates the new field value in plain text mode in locale locale based on current field value.


switchToHtml

public HTMLStringIF switchToHtml(java.util.Locale locale)
Creates the new field value in HTML mode in locale locale based on current field value.


getAvailableLocales

public java.util.Set getAvailableLocales()
Returns set of all locales where value of this object is definied. In any case returns empty, not null set.


getValue

public java.lang.String getValue(java.util.Locale locale)
Returns string representing multi language html string in locale locale. Returns null if value of multi language html string was not definied in local locale.

Specified by:
getValue in class AbstractIF

getValueBody

public IEBody getValueBody(java.util.Locale locale)
Returns object IEBody in locale locale. Returns null if value of multi language html string was not definied in local locale.


getValueMaxLength

public long getValueMaxLength(java.util.Locale locale)
Returns maximum length of html body text defined in locale locale. If body in locale locale is null, or not defined returns 0.

Specified by:
getValueMaxLength in class AbstractIF

isNullValue

public boolean isNullValue(java.util.Locale locale)
Returns true if html body text in locale locale is null or empty.

Specified by:
isNullValue in class AbstractIF

equalsTo

public boolean equalsTo(AbstractIF obj)
Compare this object to another HTMLStringIF object.

Specified by:
equalsTo in class AbstractIF

equalsTo

public boolean equalsTo(AbstractIF obj,
                        java.util.Locale locale)
Compare this object to another HTMLStringIF object. in locale locale.

Specified by:
equalsTo in class AbstractIF

setValue

public void setValue(java.lang.String str,
                     java.util.Locale locale)
Sets value of multi language string from string str in locale locale.

Specified by:
setValue in class AbstractIF

setValue

public void setValue(IEBody body,
                     java.util.Locale locale)
Sets value of multi language string from object IEBody in locale locale.


merge

public void merge(HTMLStringIF str)
Add values in MLString str to this string, if there is no locale in this object, add locale and its value from str, if there is locale in this object, replace value of this locale from str.


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


clone

public java.lang.Object clone()
Clone this object.

Specified by:
clone in class AbstractIF