Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.7.0)

E10653-08

oracle.adf.model.adapter.utils
Class Utility

java.lang.Object
  extended by oracle.adf.model.adapter.utils.Utility

public final class Utility
extends java.lang.Object

Common utilities.

Since:
10.1.3

Constructor Summary
Utility()
           
 
Method Summary
static void ASSERT(boolean flag)
          Throws an exception if the flag is set to false.
static Element getChildElement(Node parent, java.lang.String childNodeName)
          Search for a child Element given a parent element and the child name
static Node getFirstChild(Node parent, java.lang.String childName)
          Search for the First child Node of a parent given the child name
static boolean isNameValid(java.lang.String name)
          Check if a given name is valid.
static java.lang.String normalizeString(java.lang.String name)
          Normalize a string to play by the JSR 227 DT rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utility

public Utility()
Method Detail

ASSERT

public static final void ASSERT(boolean flag)
                         throws java.lang.RuntimeException
Throws an exception if the flag is set to false.

Throws:
java.lang.RuntimeException

getChildElement

public static Element getChildElement(Node parent,
                                      java.lang.String childNodeName)
Search for a child Element given a parent element and the child name


getFirstChild

public static Node getFirstChild(Node parent,
                                 java.lang.String childName)
Search for the First child Node of a parent given the child name


normalizeString

public static java.lang.String normalizeString(java.lang.String name)
Normalize a string to play by the JSR 227 DT rules. Cannot have java keywords or strings with '-' in when building the StructureDefinition.

Parameters:
name - The String to be normalized.
Returns:
The normalized string

isNameValid

public static boolean isNameValid(java.lang.String name)
Check if a given name is valid. A Name is valid iff
 
  • It begins with a character
  • The remaining characters are either alphanumeric i.e Character.isLetterOrDigit() must return true, or is an underscore.
  • The Last character must be alphanumeric. Names cannot end with underscores.
The caller is responsible for trimming any leading and trailing spaces in the parameter.

Parameters:
name - The input name which must be checked for compliance Utility
Returns:
true if the input name satisfies the conditions described above. false if any of the above conditions fail.

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.7.0)

E10653-08

Copyright © 1997, 2013, Oracle. All rights reserved.