new factory method for TextData
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / description / TextData.java
index 6bcd0c22447816a5d45f3305b51a6f9d8884f01a..8012a81225c3498f4262758fb39f2026ce5140d0 100644 (file)
@@ -121,6 +121,7 @@ public class TextData extends DescriptionElementBase implements IMultiLanguageTe
      *
      * @see #NewInstance(Feature)
      * @see #NewInstance(String, Language, TextFormat)
+     * @see    #NewInstance(Feature, String, Language, TextFormat)
      */
     public static TextData NewInstance(){
         return new TextData();
@@ -133,6 +134,7 @@ public class TextData extends DescriptionElementBase implements IMultiLanguageTe
      * @param  feature the feature the text data refer to
      * @see                    #NewInstance()
      * @see                    #NewInstance(String, Language, TextFormat)
+     * @see                                    #NewInstance(Feature, String, Language, TextFormat)
      */
     public static TextData NewInstance(Feature feature){
         return new TextData(feature);
@@ -147,6 +149,7 @@ public class TextData extends DescriptionElementBase implements IMultiLanguageTe
      * @param  format          the text format used to structure the text string
      * @see                            #NewInstance()
      * @see                            #NewInstance(Feature)
+     * @see                                    #NewInstance(Feature, String, Language, TextFormat)
      */
     public static TextData NewInstance(String text, Language language, TextFormat format){
         TextData result =  new TextData();
@@ -154,6 +157,26 @@ public class TextData extends DescriptionElementBase implements IMultiLanguageTe
         result.setFormat(format);
         return result;
     }
+    
+    
+    /**
+     * Creates a new text data instance with a given text in a given particular
+     * {@link Language language} and with the given text format for structuring it.
+     *
+     * @param   feature            the feature the text data refer to
+     * @param  text            the text string with the content of the description
+     * @param  language        the language in which the text string is formulated
+     * @param  format          the text format used to structure the text string
+     * @see                            #NewInstance()
+     * @see                            #NewInstance(Feature)
+     * @see                                    #NewInstance(String, Language, TextFormat)
+     */
+    public static TextData NewInstance(Feature feature, String text, Language language, TextFormat format){
+        TextData result =  new TextData();
+        result.putText(language, text);
+        result.setFormat(format);
+        return result;
+    }
 
     /**
      * Returns a copy of the multilanguage text with the content of <i>this</i> text data.