Skip navigation links

Oracle® WebCenter Content Site Studio for External Applications Java API Reference
11g Release 1 (11.1.1)

E17273-03


oracle.stellent.wcm.common.utils
Class WCMCommonUtils

java.lang.Object
  extended by oracle.stellent.wcm.common.utils.WCMCommonUtils


public class WCMCommonUtils
extends java.lang.Object

Nested Class Summary
static interface WCMCommonUtils.RegexAppendCallback
          Allows a user to append/modify a buffer during a call to evaluateRegexWithCallback(java.lang.String, java.lang.String, oracle.stellent.wcm.common.utils.WCMCommonUtils.RegexAppendCallback)

 

Field Summary
static java.lang.String BLANK_STRING
           
static java.lang.String SPACE_STRING
           

 

Constructor Summary
WCMCommonUtils()
           

 

Method Summary
static java.lang.String capitalize(java.lang.String name)
          This is the inverse method to the decapitalize() in the Introspector class (@see Introspector.decapitalize(String).
static java.lang.String evaluateRegexWithCallback(java.lang.String text, java.lang.String regEx, WCMCommonUtils.RegexAppendCallback callback)
          Analyze a string and invoke a callback when a match is found.
static java.lang.String getCsvFromCollection(java.util.Collection collection)
          Constructs string from a collection
static java.util.List<java.lang.String> getListFromCsv(java.lang.String value)
          Parses comma delimited string to List of String instances
static java.lang.String getSegment(java.lang.String str, java.lang.String separator, int segment)
          Returns the segment, null if not found, first segment is segment 0
static boolean isBlankOrNull(java.lang.Object value)
          Checks if a object is null, and if the object is a string then that it is not blank or null
static boolean isBlankOrNull(java.lang.String string)
          Checks if the string is a blank or null.
static boolean isJavaKeyword(java.lang.String string)
           
static boolean isJSTLELKeyword(java.lang.String string)
           
static boolean isTrue(java.lang.String string)
          Checks if a string represents a true value
static boolean isValidElementName(java.lang.String string)
          Checks if the string is a valid name for elements, which must follow the JSTL Expression Language Spec.
static boolean isValidVariableName(java.lang.String string)
           
static java.lang.String nonNull(java.lang.String original)
          This makes sure that the string not null, if it is null then an empty string is returned

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

BLANK_STRING

public static final java.lang.String BLANK_STRING
See Also:
Constant Field Values

SPACE_STRING

public static final java.lang.String SPACE_STRING
See Also:
Constant Field Values

Constructor Detail

WCMCommonUtils

public WCMCommonUtils()

Method Detail

isBlankOrNull

public static boolean isBlankOrNull(java.lang.String string)
Checks if the string is a blank or null. This interface signature is needed because the content server's components are loaded via reflection and without it you get this error: java.lang.NoSuchMethodError: oracle.stellent.wcm.common.utils.WCMCommonUtils.isBlankOrNull(Ljava/lang/String;)Z
Parameters:
string - string to be tested
Returns:
true if the string is null or blank

isBlankOrNull

public static boolean isBlankOrNull(java.lang.Object value)
Checks if a object is null, and if the object is a string then that it is not blank or null
Parameters:
value - object to check for null
Returns:
true, if null or blank

isTrue

public static boolean isTrue(java.lang.String string)
Checks if a string represents a true value
Parameters:
string -
Returns:
false unless string is "1" or starts with either "T" or "t"

getCsvFromCollection

public static java.lang.String getCsvFromCollection(java.util.Collection collection)
Constructs string from a collection
Parameters:
collection - source collection of values
Returns:
Comma-separated string as a result of values concatenation

getListFromCsv

public static java.util.List<java.lang.String> getListFromCsv(java.lang.String value)
Parses comma delimited string to List of String instances
Parameters:
value - Comma delimited string to parse
Returns:
List of Strings extractecd from comma-separated line

isValidElementName

public static boolean isValidElementName(java.lang.String string)
Checks if the string is a valid name for elements, which must follow the JSTL Expression Language Spec. The name must be a valid java variable name and must not be one of the EL reserved words http://java.sun.com/docs/books/tutorial/java/nutsandbolts/variables.html http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html
Parameters:
string -
Returns:
true if the string is a valid element name

isValidVariableName

public static boolean isValidVariableName(java.lang.String string)

isJSTLELKeyword

public static boolean isJSTLELKeyword(java.lang.String string)

isJavaKeyword

public static boolean isJavaKeyword(java.lang.String string)

getSegment

public static java.lang.String getSegment(java.lang.String str,
                                          java.lang.String separator,
                                          int segment)
Returns the segment, null if not found, first segment is segment 0
Parameters:
str - Source string
separator - Parsing separator
segment - String segment number
Returns:
Specified segment of the string extracted

evaluateRegexWithCallback

public static java.lang.String evaluateRegexWithCallback(java.lang.String text,
                                                         java.lang.String regEx,
                                                         WCMCommonUtils.RegexAppendCallback callback)
Analyze a string and invoke a callback when a match is found.
Parameters:
text - the text to analyze
regEx - the regular rexpression to match
callback - the callback to invoke when a match is found
Returns:
the modified string

capitalize

public static java.lang.String capitalize(java.lang.String name)
This is the inverse method to the decapitalize() in the Introspector class (@see Introspector.decapitalize(String). This allows as to handle names which starts with a single lowercase char followed by a upper case char in the name. We convert the starting lower case char to upper case so that the Introspector class will correctly map our names to the property names in the bean class. Currently affected names: dSecurityName, dDocAccount, xClbraUserList, xClbraAliasList
Parameters:
name - the property name
Returns:
capitalized name (only first 2 chars are capitalized if required).

nonNull

public static java.lang.String nonNull(java.lang.String original)
This makes sure that the string not null, if it is null then an empty string is returned
Parameters:
original - the original string
Returns:
the original string after trimming or an empty string if it is null.

Skip navigation links

Oracle® WebCenter Content Site Studio for External Applications Java API Reference
11g Release 1 (11.1.1)

E17273-03


Copyright © 2010, 2011, Oracle and/or its affiliates. All rights reserved.