|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.sco.SCOHelper
Helper class used by Tracked SCO implementations. Contains static methods to allow to simplify implementations of SCO classes in the same package without extending the same base class, which is impossible as each Tracked SCO class extends corresponding "regular" SCO.
Field Summary | |
private static java.lang.String |
EXC_ElementClassCastException
|
private static java.lang.String |
EXC_ElementNullsNotAllowed
Message keys for assertions performed. |
private static java.lang.String |
EXC_KeyClassCastException
|
private static java.lang.String |
EXC_KeyNullsNotAllowed
|
private static java.lang.String |
EXC_ValueClassCastException
|
private static java.lang.String |
EXC_ValueNullsNotAllowed
|
private static org.apache.commons.logging.Log |
logger
Logger for SCO classes. |
private static I18NHelper |
msg
I18N message handler |
Constructor Summary | |
(package private) |
SCOHelper()
|
Method Summary | |
protected static void |
assertElementType(java.lang.Object o,
java.lang.Class elementType)
Verifies that the component to insert is of correct type |
protected static void |
assertKeyType(java.lang.Object o,
java.lang.Class keyType)
Verifies that the key to insert is of correct type. |
protected static void |
assertNullKeysAllowed(java.lang.Object o,
boolean allowNulls)
Verifies if null values are allowed for keys of an SCOMap. |
protected static void |
assertNulls(java.lang.Object o,
boolean allowNulls,
java.lang.String exc)
Verifies if nulls are allowed as instances of this SCO. |
protected static void |
assertNullsAllowed(java.lang.Object o,
boolean allowNulls)
Verifies if null values are allowed for elements of an SCOCollection. |
protected static void |
assertNullValuesAllowed(java.lang.Object o,
boolean allowNulls)
Verifies if null values are allowed for values of an SCOMap. |
private static void |
assertType(java.lang.Object o,
java.lang.Class type,
java.lang.String exc)
Verifies that the value to insert is of correct type. |
protected static void |
assertValueType(java.lang.Object o,
java.lang.Class valueType)
Verifies that the value to insert is of correct type. |
protected static void |
debug(java.lang.String name,
java.lang.String msg)
Tracing method for other SCO implementations. |
protected static java.lang.String |
getFieldName(StateManagerInternal owner,
int fieldNumber)
Returns the field name |
protected static java.lang.Object |
getOwner(StateManagerInternal owner)
Returns the owner object of the SCO instance |
protected static void |
validateResult(int l,
java.lang.Throwable[] err)
Helper method to validate errors on processing arrays of objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String EXC_ElementNullsNotAllowed
private static final java.lang.String EXC_KeyNullsNotAllowed
private static final java.lang.String EXC_ValueNullsNotAllowed
private static final java.lang.String EXC_ElementClassCastException
private static final java.lang.String EXC_KeyClassCastException
private static final java.lang.String EXC_ValueClassCastException
private static final I18NHelper msg
private static final org.apache.commons.logging.Log logger
Constructor Detail |
SCOHelper()
Method Detail |
protected static void assertNullsAllowed(java.lang.Object o, boolean allowNulls)
o
- the object to validateallowNulls
- true if nulls are allowed
javax.jdo.JDOUserException
- if null values are not allowed and the component
to insert is null.protected static void assertNullKeysAllowed(java.lang.Object o, boolean allowNulls)
o
- the key to validateallowNulls
- true if nulls are allowed
javax.jdo.JDOUserException
- if null values are not allowed and the key
to set is null.protected static void assertNullValuesAllowed(java.lang.Object o, boolean allowNulls)
o
- the value to validate.allowNulls
- true if nulls are allowed.
javax.jdo.JDOUserException
- if null values are not allowed and the value
to insert is null.protected static void assertElementType(java.lang.Object o, java.lang.Class elementType)
o
- the object to validate.elementType
- the element types allowed.
javax.jdo.JDOUserException
- if validation fails.protected static void assertKeyType(java.lang.Object o, java.lang.Class keyType)
o
- the key to validate.keyType
- the key types allowed.
javax.jdo.JDOUserException
- if validation fails.protected static void assertValueType(java.lang.Object o, java.lang.Class valueType)
o
- the value to validate.valueType
- the value types allowed.
javax.jdo.JDOUserException
- if validation fails.protected static void validateResult(int l, java.lang.Throwable[] err)
l
- actual size of the arrayerr
- array of Throwable to validate
javax.jdo.JDOUserException
- if l
is greater than 0.protected static void assertNulls(java.lang.Object o, boolean allowNulls, java.lang.String exc)
o
- the instance to validate.allowNulls
- true if nulls are allowed.exc
- message key for the exception to be thrown.
javax.jdo.JDOUserException
- if validation fails.private static void assertType(java.lang.Object o, java.lang.Class type, java.lang.String exc)
o
- the value to validate.type
- the Class of types allowed.exc
- message key for the exception to be thrown.
javax.jdo.JDOUserException
- if validation fails.protected static java.lang.Object getOwner(StateManagerInternal owner)
protected static java.lang.String getFieldName(StateManagerInternal owner, int fieldNumber)
protected static void debug(java.lang.String name, java.lang.String msg)
name
- Class name of an instance calling the method.msg
- String to display.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |