Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

oracle.portal.provider.v2.utils
Class ValidationError

java.lang.Object
  extended by oracle.portal.provider.v2.utils.ValidationError

public class ValidationError
extends java.lang.Object

A ValidationError maintains a list of ValidationError.Errors reported by a tree of Validateable objects during validation traversal.

Context information, such as the location within a tree of objects, is supplied using the utility newContext(String, String, String) method.


Nested Class Summary
static class ValidationError.Error
          Encapsulates information relating to a single error.
 
Constructor Summary
ValidationError()
          Constructs this ValidationError instance.
 
Method Summary
 void addError(java.lang.String context, java.lang.String message, java.lang.String values)
          Adds an error to the list maintained by this ValidationError instance.
 boolean isEmpty()
          Indicates whether or not this ValidationError instance is currently empty.
 java.util.Iterator iterator()
          Returns a java.util.Iterator providing ordered retrieval of the ValidationError.Errors entered into this ValidationError instance.
static java.lang.String newContext(java.lang.String parentContext, java.lang.String typeName, java.lang.String objName)
          Returns a new context string containing the parent context and current context delimited by a ">&quot character.
 java.lang.String toString()
          Returns a java.lang.String representation of this ValidationError instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationError

public ValidationError()
Constructs this ValidationError instance.

Method Detail

addError

public void addError(java.lang.String context,
                     java.lang.String message,
                     java.lang.String values)
Adds an error to the list maintained by this ValidationError instance. The context information supplied should conatin the context information of entities calling the current Validateable. This will be the case if the utility newContext(String, String, String) was used.

Parameters:
context - Current context information.
message - The error message.
values - The error values.

iterator

public java.util.Iterator iterator()
Returns a java.util.Iterator providing ordered retrieval of the ValidationError.Errors entered into this ValidationError instance.

Returns:
a java.util.Iterator whose members are of type ValidationError.Error.

isEmpty

public boolean isEmpty()
Indicates whether or not this ValidationError instance is currently empty.

Returns:
a boolean flag.

toString

public java.lang.String toString()
Returns a java.lang.String representation of this ValidationError instance.

Overrides:
toString in class java.lang.Object

newContext

public static java.lang.String newContext(java.lang.String parentContext,
                                          java.lang.String typeName,
                                          java.lang.String objName)
Returns a new context string containing the parent context and current context delimited by a ">&quot character. The current context is constructed from the supplied object type name and object instance name (if any).

Parameters:
parentContext - The parent context.
typeName - The type name of the current Validateable instance.
objName - The instance name of the current Validateable instance.
Returns:
a new context string or null if it was not possible t construct one from the supplied information.

Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.