Package com.logicaldoc.util
Class TagUtil
- java.lang.Object
 - 
- com.logicaldoc.util.TagUtil
 
 
- 
public class TagUtil extends Object
Utility class for tags handling- Since:
 - 4.5
 - Author:
 - Marco Meschieri - LogicalDOC
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static intMAX_FIELD_LENGTH 
- 
Constructor Summary
Constructors Constructor Description TagUtil() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<String>extractTags(String tenantName, String words)Detects words in the passed string and creates a list of tags.static StringnormalizeTags(String tenantName, String words)Normalizes the passed string extracting all tags and producing anither string containing all tags separated by a comma. 
 - 
 
- 
- 
Field Detail
- 
MAX_FIELD_LENGTH
public static final int MAX_FIELD_LENGTH
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
extractTags
public static Set<String> extractTags(String tenantName, String words)
Detects words in the passed string and creates a list of tags.
Atention: Recognized tags are words of min. MIN_CHARS chars and max MAX_CHARS characters.- Parameters:
 tenantName- name of the tenantwords- a string of words (tags are separated by ,);- Returns:
 - the collection of tags
 
 
- 
normalizeTags
public static String normalizeTags(String tenantName, String words)
Normalizes the passed string extracting all tags and producing anither string containing all tags separated by a comma.Atention: The returned string is not more long than MAX_FIELD_LENGTH characters.
- Parameters:
 tenantName- Name of the tenantwords- The string to be normalized- Returns:
 - a string in the form "tag1,tag2,tag3"
 
 
 - 
 
 -