org.objectweb.jorm.naming.lib
Class BasicCompositePName

java.lang.Object
  extended byorg.objectweb.jorm.naming.lib.BasicPName
      extended byorg.objectweb.jorm.naming.lib.BasicPolymorphicPName
          extended byorg.objectweb.jorm.naming.lib.BasicCompositePName
All Implemented Interfaces:
java.lang.Cloneable, PName, PNameGetter, PolymorphicPName, java.io.Serializable

public abstract class BasicCompositePName
extends BasicPolymorphicPName
implements PNameGetter

This abstract class helps the implementation of PName for composite name.

Author:
S.Chassande-Barrioz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jorm.naming.lib.BasicPolymorphicPName
polymorphic
 
Fields inherited from class org.objectweb.jorm.naming.lib.BasicPName
pnc
 
Constructor Summary
BasicCompositePName()
           
 
Method Summary
protected abstract  boolean checkPName(java.lang.Object obj)
           
 boolean equal(byte[] ba1, byte[] ba2)
           
 boolean equal(char[] ba1, char[] ba2)
           
 boolean equals(java.lang.Object obj)
          Overides the equals method.
 boolean isNull()
          It tells if this name corresponds to "null" representation within a its naming context.
 java.math.BigDecimal pngetBigDecimalField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a BigDecimal field.
 java.math.BigInteger pngetBigIntegerField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a BigInteger field.
 byte[] pngetByteArrayField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a byte[] field.
 byte pngetByteField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a byte field.
 char[] pngetCharArrayField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a char[] field.
 char pngetCharField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a char field.
 java.util.Date pngetDateField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a date field.
 int pngetIntField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of an int field.
 long pngetLongField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a long field.
 java.lang.Byte pngetObyteField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a Byte field.
 java.lang.Character pngetOcharField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a Character field.
 java.lang.Integer pngetOintField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of an Integer field.
 java.lang.Long pngetOlongField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a Long field.
 java.lang.Short pngetOshortField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a Short field.
 short pngetShortField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a short field.
 java.lang.String pngetStringField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a string field.
protected abstract  boolean valuesEqual(PName obj)
           
 
Methods inherited from class org.objectweb.jorm.naming.lib.BasicPolymorphicPName
isPolymorphic, setPNameManager, setPolymorphic
 
Methods inherited from class org.objectweb.jorm.naming.lib.BasicPName
codingSupported, encode, encodeAbstract, encodeBigDecimal, encodeBigInteger, encodeByte, encodeChar, encodeCharArray, encodeDate, encodeInt, encodeLong, encodeObyte, encodeOchar, encodeOint, encodeOlong, encodeOshort, encodeShort, encodeString, export, export, getPNameManager, getPType, resolve, setPNamingContext, toString, unexport, unexport
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.naming.api.PName
codingSupported, encode, encodeAbstract, encodeBigDecimal, encodeBigInteger, encodeByte, encodeChar, encodeCharArray, encodeDate, encodeInt, encodeLong, encodeObyte, encodeOchar, encodeOint, encodeOlong, encodeOshort, encodeShort, encodeString, export, export, getPNameManager, getPType, resolve, unexport, unexport
 

Constructor Detail

BasicCompositePName

public BasicCompositePName()
Method Detail

checkPName

protected abstract boolean checkPName(java.lang.Object obj)

valuesEqual

protected abstract boolean valuesEqual(PName obj)

isNull

public boolean isNull()
Description copied from interface: PName
It tells if this name corresponds to "null" representation within a its naming context.

Specified by:
isNull in interface PName
Returns:
true if it represents a "null" name.

equals

public boolean equals(java.lang.Object obj)
Overides the equals method. If none of the 2 pnames is ploymorphic, uses the normal equals method. If this pname is polymorphic, compare the values. If the obj pname is polymorphic, call obj.equals(this).


equal

public boolean equal(char[] ba1,
                     char[] ba2)

equal

public boolean equal(byte[] ba1,
                     byte[] ba2)

pngetByteField

public byte pngetByteField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PException
Description copied from interface: PNameGetter
It retrieves the value of a byte field.

Specified by:
pngetByteField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The byte value of the field as stored within the composite name.
Throws:
PException

pngetObyteField

public java.lang.Byte pngetObyteField(java.lang.String fn,
                                      java.lang.Object ctx)
                               throws PException
Description copied from interface: PNameGetter
It retrieves the value of a Byte field.

Specified by:
pngetObyteField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The Byte value of the field as stored within the composite name.
Throws:
PException

pngetCharField

public char pngetCharField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PException
Description copied from interface: PNameGetter
It retrieves the value of a char field.

Specified by:
pngetCharField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The char value of the field as stored within the composite name.
Throws:
PException

pngetOcharField

public java.lang.Character pngetOcharField(java.lang.String fn,
                                           java.lang.Object ctx)
                                    throws PException
Description copied from interface: PNameGetter
It retrieves the value of a Character field.

Specified by:
pngetOcharField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The Character value of the field as stored within the composite name.
Throws:
PException

pngetShortField

public short pngetShortField(java.lang.String fn,
                             java.lang.Object ctx)
                      throws PException
Description copied from interface: PNameGetter
It retrieves the value of a short field.

Specified by:
pngetShortField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data. In in the case of RDB, it can be the result set.
Returns:
The short value of the field as stored within the composite name.
Throws:
PException

pngetOshortField

public java.lang.Short pngetOshortField(java.lang.String fn,
                                        java.lang.Object ctx)
                                 throws PException
Description copied from interface: PNameGetter
It retrieves the value of a Short field.

Specified by:
pngetOshortField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The Short value of the field as stored within the composite name.
Throws:
PException

pngetIntField

public int pngetIntField(java.lang.String fn,
                         java.lang.Object ctx)
                  throws PException
Description copied from interface: PNameGetter
It retrieves the value of an int field.

Specified by:
pngetIntField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The int value of the field as stored within the composite name.
Throws:
PException

pngetOintField

public java.lang.Integer pngetOintField(java.lang.String fn,
                                        java.lang.Object ctx)
                                 throws PException
Description copied from interface: PNameGetter
It retrieves the value of an Integer field.

Specified by:
pngetOintField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The Integer value of the field as stored within the composite name.
Throws:
PException

pngetLongField

public long pngetLongField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PException
Description copied from interface: PNameGetter
It retrieves the value of a long field.

Specified by:
pngetLongField in interface PNameGetter
Parameters:
ctx - A context used by PNameGetter to extract the related data.
fn - A String containing the name of the field.
Returns:
The long value of the field as stored within the composite name.
Throws:
PException

pngetOlongField

public java.lang.Long pngetOlongField(java.lang.String fn,
                                      java.lang.Object ctx)
                               throws PException
Description copied from interface: PNameGetter
It retrieves the value of a Long field.

Specified by:
pngetOlongField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The Long value of the field as stored within the composite name.
Throws:
PException

pngetStringField

public java.lang.String pngetStringField(java.lang.String fn,
                                         java.lang.Object ctx)
                                  throws PException
Description copied from interface: PNameGetter
It retrieves the value of a string field.

Specified by:
pngetStringField in interface PNameGetter
Parameters:
ctx - A context used by PNameGetter to extract the related data.
fn - A String containing the name of the field.
Returns:
The java.lang.String value of the field as stored within the composite name.
Throws:
PException

pngetByteArrayField

public byte[] pngetByteArrayField(java.lang.String fn,
                                  java.lang.Object ctx)
                           throws PException
Description copied from interface: PNameGetter
It retrieves the value of a byte[] field.

Specified by:
pngetByteArrayField in interface PNameGetter
Parameters:
ctx - A context used by PNameGetter to extract the related data.
fn - A String containing the name of the field.
Returns:
The byte[] value of the field as stored within the composite name.
Throws:
PException

pngetCharArrayField

public char[] pngetCharArrayField(java.lang.String fn,
                                  java.lang.Object ctx)
                           throws PException
Description copied from interface: PNameGetter
It retrieves the value of a char[] field.

Specified by:
pngetCharArrayField in interface PNameGetter
Parameters:
ctx - A context used by PNameGetter to extract the related data.
fn - A String containing the name of the field.
Returns:
The char[] value of the field as stored within the composite name.
Throws:
PException

pngetDateField

public java.util.Date pngetDateField(java.lang.String fn,
                                     java.lang.Object ctx)
                              throws PException
Description copied from interface: PNameGetter
It retrieves the value of a date field.

Specified by:
pngetDateField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The java.util.Date value of the field as stored within the composite name.
Throws:
PException

pngetBigIntegerField

public java.math.BigInteger pngetBigIntegerField(java.lang.String fn,
                                                 java.lang.Object ctx)
                                          throws PException
Description copied from interface: PNameGetter
It retrieves the value of a BigInteger field.

Specified by:
pngetBigIntegerField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The java.math.BigInteger value of the field as stored within the composite name.
Throws:
PException

pngetBigDecimalField

public java.math.BigDecimal pngetBigDecimalField(java.lang.String fn,
                                                 java.lang.Object ctx)
                                          throws PException
Description copied from interface: PNameGetter
It retrieves the value of a BigDecimal field.

Specified by:
pngetBigDecimalField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The java.math.BigDecimal value of the field as stored within the composite name.
Throws:
PException