Skip navigation links

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

E17273-01


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 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 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)
           

 

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

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

Skip navigation links

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

E17273-01


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