org.objectweb.jorm.naming.lib
Class BasicPolymorphicPNamingContext

java.lang.Object
  extended byorg.objectweb.jorm.naming.lib.BasicPolymorphicPNamingContext
All Implemented Interfaces:
PNameCoder, PNameManager, PNamingContext, PolymorphicPNamingContext

public class BasicPolymorphicPNamingContext
extends java.lang.Object
implements PolymorphicPNamingContext

This class is used to encode/decode asymetric PNames. It is linked to a delegated Binder to which all the encode/decode calls are delegated. It is linked to the cache to perform lookup on resolve(PName) and decodeXX(). It is liked to a PClassMapping to delegate the resolve call in case the PName is not in the cache.

Author:
Y.Bersihand

Field Summary
 
Fields inherited from interface org.objectweb.jorm.naming.api.PNameCoder
CTBIGDECIMAL, CTBIGINTEGER, CTBYTE, CTBYTEARRAY, CTCHAR, CTCHARARRAY, CTCOMPOSITE, CTDATE, CTINT, CTLONG, CTOBYTE, CTOCHAR, CTOINT, CTOLONG, CTOSHORT, CTSHORT, CTSTRING, CTSYSTEM
 
Constructor Summary
BasicPolymorphicPNamingContext()
           
BasicPolymorphicPNamingContext(PBinder delegatedBinder, PClassMapping pcm, CacheManager cache, PNameManager delegatedPNM)
           
 
Method Summary
 boolean codingSupported(int codingtype)
          It tests if a given coding type is supported by this naming context.
 PName decode(byte[] en)
          The decode methods recreates PName within a naming context from an encoded representation.
 PName decodeAbstract(java.lang.Object en, java.lang.Object context)
          The decodeAbstract methods recreates PName within a naming context from an encoded representation.
 PName decodeBigDecimal(java.math.BigDecimal en)
          The decodeBigDecimal methods recreates PName within a naming context from an encoded representation.
 PName decodeBigInteger(java.math.BigInteger en)
          The decodeBigInteger methods recreates PName within a naming context from an encoded representation.
 PName decodeByte(byte en)
          The decodeByte methods recreates PName within a naming context from an encoded representation.
 PName decodeChar(char en)
          The decodeChar methods recreates PName within a naming context from an encoded representation.
 PName decodeCharArray(char[] en)
          The decodeCharArray methods recreates PName within a naming context from an encoded representation.
 PName decodeDate(java.util.Date en)
          The decodeDate methods recreates PName within a naming context from an encoded representation.
 PName decodeInt(int en)
          The decodeInt methods recreates PName within a naming context from an encoded representation.
 PName decodeLong(long en)
          The decodeLong methods recreates PName within a naming context from an encoded representation.
 PName decodeObyte(java.lang.Byte en)
          The decodeObyte methods recreates PName within a naming context from an encoded representation.
 PName decodeOchar(java.lang.Character en)
          The decodeOchar methods recreates PName within a naming context from an encoded representation.
 PName decodeOint(java.lang.Integer en)
          The decodeOint methods recreates PName within a naming context from an encoded representation.
 PName decodeOlong(java.lang.Long en)
          The decodeOlong methods recreates PName within a naming context from an encoded representation.
 PName decodeOshort(java.lang.Short en)
          The decodeOshort methods recreates PName within a naming context from an encoded representation.
 PName decodeShort(short en)
          The decodeShort methods recreates PName within a naming context from an encoded representation.
 PName decodeString(java.lang.String en)
          The decodeString methods recreates PName within a naming context from an encoded representation.
 byte[] encode(PName pn)
          The encode method produces an encoded representation of a PName within a naming context.
 java.lang.Object encodeAbstract(PName pn)
          The encodeAbstract method produces an encoded representation of a PName within a naming context.
 java.math.BigDecimal encodeBigDecimal(PName pn)
          The encodeBigDecimal method produces an encoded representation of a PName within a naming context.
 java.math.BigInteger encodeBigInteger(PName pn)
          The encodeBigInteger method produces an encoded representation of a PName within a naming context.
 byte encodeByte(PName pn)
          The encodeByte method produces an encoded representation of a PName within a naming context.
 char encodeChar(PName pn)
          The encodeChar method produces an encoded representation of a PName within a naming context.
 char[] encodeCharArray(PName pn)
          The encodeCharArray method produces an encoded representation of a PName within a naming context.
 java.util.Date encodeDate(PName pn)
          The encodeDate method produces an encoded representation of a PName within a naming context.
 int encodeInt(PName pn)
          The encodeInt method produces an encoded representation of a PName within a naming context.
 long encodeLong(PName pn)
          The encodeLong method produces an encoded representation of a PName within a naming context.
 java.lang.Byte encodeObyte(PName pn)
          The encodeObyte method produces an encoded representation of a PName within a naming context.
 java.lang.Character encodeOchar(PName pn)
          The encodeOchar method produces an encoded representation of a PName within a naming context.
 java.lang.Integer encodeOint(PName pn)
          The encodeOint method produces an encoded representation of a PName within a naming context.
 java.lang.Long encodeOlong(PName pn)
          The encodeOlong method produces an encoded representation of a PName within a naming context.
 java.lang.Short encodeOshort(PName pn)
          The encodeOshort method produces an encoded representation of a PName within a naming context.
 short encodeShort(PName pn)
          The encodeShort method produces an encoded representation of a PName within a naming context.
 java.lang.String encodeString(PName pn)
          The encodeString method produces an encoded representation of a PName within a naming context.
 PName export(java.lang.Object conn, java.lang.Object infoitem)
          It associates a PName to an information item within a naming context.
 PName export(java.lang.Object conn, java.lang.Object infoitem, java.lang.Object hints)
          It associates a PName to an information item within a naming context.
 CacheManager getCache()
          Get the cache.
 PBinder getDelegatedBinder()
          Get the delegated PBinder.
 PName getNull()
          It yields a "null" representation of a name within this naming context.
 PClassMapping getPcm()
          Get the PClassMapping.
 PType getPType()
          Retrieves the PType associated to the JORM class which is the type of the name managed by this naming context.
 PName resolve(java.lang.Object conn, PName pname)
          It retrieves the information item associated to the given PName (if any exists).
 void setCache(CacheManager cache)
          Set the cache (used to perform lookup).
 void setDelegatedBinder(PBinder delegatedBinder)
          Set the delegated PBinder.
 void setNullPName(java.lang.Object o)
          It assignes a object which defines a null representation of a name within this naming context.
 void setPcm(PClassMapping pcm)
          Set the PClassMapping.
 void setPType(PType pt)
          Assigns the PType associated to the JORM class which is the type of the name managed by this naming context.
 boolean supportCompositeField(java.lang.String fn, PType ft)
          In case of a naming context that supports composite names (i.e., names composed of several typed fields, whose type is limited to scalar ones), it tests if a particular field is defined by this composite name.
 boolean supportDynamicComposite()
          Tests if this naming context supports comosite name through a dynamic approach, which means that encodingAbstract/decodingAbstract use getter objects that implement the PNameGetter interface.
 boolean supportStaticComposite()
          Tests if this naming context supports comosite name through a static approach, which means that encodingAbstract/decodingAbstract use getter objects that implement specific NsFieldGetter interface generated for a particular field "Field" within a particular NameDef space "Ns".
 void unexport(java.lang.Object conn, PName pn)
          It removes the PName and all the associated information within a naming context (i.e., the association between the PName and its information item).
 void unexport(java.lang.Object conn, PName pn, java.lang.Object hints)
          It removes the PName and all the associated information within a naming context (i.e., the association between the PName and its information item).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicPolymorphicPNamingContext

public BasicPolymorphicPNamingContext()

BasicPolymorphicPNamingContext

public BasicPolymorphicPNamingContext(PBinder delegatedBinder,
                                      PClassMapping pcm,
                                      CacheManager cache,
                                      PNameManager delegatedPNM)
Method Detail

getCache

public CacheManager getCache()
Description copied from interface: PolymorphicPNamingContext
Get the cache.

Specified by:
getCache in interface PolymorphicPNamingContext

setCache

public void setCache(CacheManager cache)
Description copied from interface: PolymorphicPNamingContext
Set the cache (used to perform lookup).

Specified by:
setCache in interface PolymorphicPNamingContext

getDelegatedBinder

public PBinder getDelegatedBinder()
Description copied from interface: PolymorphicPNamingContext
Get the delegated PBinder.

Specified by:
getDelegatedBinder in interface PolymorphicPNamingContext

setDelegatedBinder

public void setDelegatedBinder(PBinder delegatedBinder)
Description copied from interface: PolymorphicPNamingContext
Set the delegated PBinder.

Specified by:
setDelegatedBinder in interface PolymorphicPNamingContext

getPcm

public PClassMapping getPcm()
Description copied from interface: PolymorphicPNamingContext
Get the PClassMapping.

Specified by:
getPcm in interface PolymorphicPNamingContext

setPcm

public void setPcm(PClassMapping pcm)
Description copied from interface: PolymorphicPNamingContext
Set the PClassMapping.

Specified by:
setPcm in interface PolymorphicPNamingContext

resolve

public PName resolve(java.lang.Object conn,
                     PName pname)
              throws PException
Description copied from interface: PNamingContext
It retrieves the information item associated to the given PName (if any exists).

Specified by:
resolve in interface PNamingContext
Parameters:
conn - The connection that can be used to access the data store.
pname - The PName to be looked up.
Returns:
The information item associated with the given PName within a naming context.
Throws:
PException

export

public PName export(java.lang.Object conn,
                    java.lang.Object infoitem)
             throws PException
Description copied from interface: PNameManager
It associates a PName to an information item within a naming context.

Specified by:
export in interface PNameManager
Parameters:
conn - The connection that can be used to access the data store.
infoitem - The information item that must be accessible through a PName within a naming context.
Returns:
The PName associated to the given information item.
Throws:
PException

export

public PName export(java.lang.Object conn,
                    java.lang.Object infoitem,
                    java.lang.Object hints)
             throws PException
Description copied from interface: PNameManager
It associates a PName to an information item within a naming context.

Specified by:
export in interface PNameManager
Parameters:
conn - The connection that can be used to access the data store.
infoitem - The information item that must be accessible through a PName within a naming context.
hints - Any information relevant for name creation.
Returns:
The PName associated to the given information item.
Throws:
PException

unexport

public void unexport(java.lang.Object conn,
                     PName pn)
              throws PException
Description copied from interface: PNameManager
It removes the PName and all the associated information within a naming context (i.e., the association between the PName and its information item).

Specified by:
unexport in interface PNameManager
Parameters:
conn - The connection that can be used to access the data store.
pn - A PName valid in this naming context. In case of a PBinder, export is done on a PBinding.
Throws:
PException

unexport

public void unexport(java.lang.Object conn,
                     PName pn,
                     java.lang.Object hints)
              throws PException
Description copied from interface: PNameManager
It removes the PName and all the associated information within a naming context (i.e., the association between the PName and its information item).

Specified by:
unexport in interface PNameManager
Parameters:
conn - The connection that can be used to access the data store.
pn - A PName valid in this naming context. In case of a PBinder, export is done on a PBinding.
hints - Any information relevant for name removing.
Throws:
PException

codingSupported

public boolean codingSupported(int codingtype)
Description copied from interface: PNameCoder
It tests if a given coding type is supported by this naming context.

Specified by:
codingSupported in interface PNameCoder
Parameters:
codingtype - One of the coding type defined by CTxxx constants defined within this interface.
Returns:
It returns true if the coding type is supported by this naming context.

decode

public PName decode(byte[] en)
             throws PExceptionNaming
Description copied from interface: PNameCoder
The decode methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is an array of bytes. It must always be supported by a naming context.

Specified by:
decode in interface PNameCoder
Parameters:
en - The byte to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming

decodeAbstract

public PName decodeAbstract(java.lang.Object en,
                            java.lang.Object context)
                     throws PExceptionNaming,
                            java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeAbstract methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is abstract, which means that this is a Java object of any complexity. One example of such object is a getter interface representing a relational primary key (also called composite names).

Specified by:
decodeAbstract in interface PNameCoder
Parameters:
context - A context used to decode the related data.
en - The Object to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeByte

public PName decodeByte(byte en)
                 throws PExceptionNaming,
                        java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeByte methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a byte.

Specified by:
decodeByte in interface PNameCoder
Parameters:
en - The byte to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeObyte

public PName decodeObyte(java.lang.Byte en)
                  throws PExceptionNaming,
                         java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeObyte methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a byte.

Specified by:
decodeObyte in interface PNameCoder
Parameters:
en - The Byte to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeChar

public PName decodeChar(char en)
                 throws PExceptionNaming,
                        java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeChar methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a char.

Specified by:
decodeChar in interface PNameCoder
Parameters:
en - The char to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeOchar

public PName decodeOchar(java.lang.Character en)
                  throws PExceptionNaming,
                         java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeOchar methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a Character.

Specified by:
decodeOchar in interface PNameCoder
Parameters:
en - The Character to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeInt

public PName decodeInt(int en)
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeInt methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is an int.

Specified by:
decodeInt in interface PNameCoder
Parameters:
en - The int to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeOint

public PName decodeOint(java.lang.Integer en)
                 throws PExceptionNaming,
                        java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeOint methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is an Integer.

Specified by:
decodeOint in interface PNameCoder
Parameters:
en - The Integer to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeLong

public PName decodeLong(long en)
                 throws PExceptionNaming,
                        java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeLong methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a long.

Specified by:
decodeLong in interface PNameCoder
Parameters:
en - The long to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeOlong

public PName decodeOlong(java.lang.Long en)
                  throws PExceptionNaming,
                         java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeOlong methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a Long.

Specified by:
decodeOlong in interface PNameCoder
Parameters:
en - The Long to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeShort

public PName decodeShort(short en)
                  throws PExceptionNaming,
                         java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeShort methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a short.

Specified by:
decodeShort in interface PNameCoder
Parameters:
en - The short to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeOshort

public PName decodeOshort(java.lang.Short en)
                   throws PExceptionNaming,
                          java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeOshort methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a Short.

Specified by:
decodeOshort in interface PNameCoder
Parameters:
en - The Short to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeString

public PName decodeString(java.lang.String en)
                   throws PExceptionNaming
Description copied from interface: PNameCoder
The decodeString methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a String.

Specified by:
decodeString in interface PNameCoder
Parameters:
en - The String to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming

decodeCharArray

public PName decodeCharArray(char[] en)
                      throws PExceptionNaming
Description copied from interface: PNameCoder
The decodeCharArray methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a String.

Specified by:
decodeCharArray in interface PNameCoder
Parameters:
en - The char[] to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming

decodeDate

public PName decodeDate(java.util.Date en)
                 throws PExceptionNaming
Description copied from interface: PNameCoder
The decodeDate methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a Date.

Specified by:
decodeDate in interface PNameCoder
Parameters:
en - The Date to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming

decodeBigInteger

public PName decodeBigInteger(java.math.BigInteger en)
                       throws PExceptionNaming
Description copied from interface: PNameCoder
The decodeBigInteger methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a BigInteger.

Specified by:
decodeBigInteger in interface PNameCoder
Parameters:
en - The BigInteger to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming

decodeBigDecimal

public PName decodeBigDecimal(java.math.BigDecimal en)
                       throws PExceptionNaming
Description copied from interface: PNameCoder
The decodeBigDecimal methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a BigDecimal.

Specified by:
decodeBigDecimal in interface PNameCoder
Parameters:
en - The BigDecimal to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming

encode

public byte[] encode(PName pn)
              throws PExceptionNaming
Description copied from interface: PNameCoder
The encode method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is an array of bytes. It must be always supported by a naming context.

Specified by:
encode in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The array of bytes corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeAbstract

public java.lang.Object encodeAbstract(PName pn)
                                throws PExceptionNaming,
                                       java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeAbstract method produces an encoded representation of a PName within a naming context. The encoding format is the case of this method is a Java object of any complexity. Example of such object is a getter interface giving access of the fields of a relational primary key (also called composite names).

Specified by:
encodeAbstract in interface PNameCoder
Parameters:
pn - The PName to be encoded.
Returns:
The Object corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeByte

public byte encodeByte(PName pn)
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeByte method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a byte.

Specified by:
encodeByte in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The byte corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeObyte

public java.lang.Byte encodeObyte(PName pn)
                           throws PExceptionNaming,
                                  java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeObyte method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a Byte.

Specified by:
encodeObyte in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The Byte corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeChar

public char encodeChar(PName pn)
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeChar method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a char.

Specified by:
encodeChar in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The char corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOchar

public java.lang.Character encodeOchar(PName pn)
                                throws PExceptionNaming,
                                       java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeOchar method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a Character.

Specified by:
encodeOchar in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The Character corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeInt

public int encodeInt(PName pn)
              throws PExceptionNaming,
                     java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeInt method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a int.

Specified by:
encodeInt in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The int corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOint

public java.lang.Integer encodeOint(PName pn)
                             throws PExceptionNaming,
                                    java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeOint method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a Integer.

Specified by:
encodeOint in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The Integer corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeLong

public long encodeLong(PName pn)
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeLong method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a long.

Specified by:
encodeLong in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The long corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOlong

public java.lang.Long encodeOlong(PName pn)
                           throws PExceptionNaming,
                                  java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeOlong method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a Long.

Specified by:
encodeOlong in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The Long corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeShort

public short encodeShort(PName pn)
                  throws PExceptionNaming,
                         java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeShort method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a short.

Specified by:
encodeShort in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The short corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOshort

public java.lang.Short encodeOshort(PName pn)
                             throws PExceptionNaming,
                                    java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The encodeOshort method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a Short.

Specified by:
encodeOshort in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The Short corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeString

public java.lang.String encodeString(PName pn)
                              throws PExceptionNaming
Description copied from interface: PNameCoder
The encodeString method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a String.

Specified by:
encodeString in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The String corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeCharArray

public char[] encodeCharArray(PName pn)
                       throws PExceptionNaming
Description copied from interface: PNameCoder
The encodeCharArray method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a char[].

Specified by:
encodeCharArray in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The char[] corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeDate

public java.util.Date encodeDate(PName pn)
                          throws PExceptionNaming
Description copied from interface: PNameCoder
The encodeDate method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a Date.

Specified by:
encodeDate in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The Date corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeBigInteger

public java.math.BigInteger encodeBigInteger(PName pn)
                                      throws PExceptionNaming
Description copied from interface: PNameCoder
The encodeBigInteger method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a BigInteger.

Specified by:
encodeBigInteger in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The BigInteger corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeBigDecimal

public java.math.BigDecimal encodeBigDecimal(PName pn)
                                      throws PExceptionNaming
Description copied from interface: PNameCoder
The encodeBigDecimal method produces an encoded representation of a PName within a naming context. The encoding format in the case of this method is a BigDecimal.

Specified by:
encodeBigDecimal in interface PNameCoder
Parameters:
pn - The PName to be encoded
Returns:
The BigDecimal corresponding to the encoded representation.
Throws:
PExceptionNaming

getNull

public PName getNull()
Description copied from interface: PNameCoder
It yields a "null" representation of a name within this naming context.

Specified by:
getNull in interface PNameCoder
Returns:
The "null" PName associated with this naming context.

setNullPName

public void setNullPName(java.lang.Object o)
                  throws PException
Description copied from interface: PNameCoder
It assignes a object which defines a null representation of a name within this naming context.

Specified by:
setNullPName in interface PNameCoder
Parameters:
o - can be a PNameGetter (generic or generated), a pname, or a simple value (ex: Integer).
Throws:
PException

supportDynamicComposite

public boolean supportDynamicComposite()
Description copied from interface: PNameCoder
Tests if this naming context supports comosite name through a dynamic approach, which means that encodingAbstract/decodingAbstract use getter objects that implement the PNameGetter interface.

Specified by:
supportDynamicComposite in interface PNameCoder
Returns:
true if dynamic getter is supported by composite name coding.

supportCompositeField

public boolean supportCompositeField(java.lang.String fn,
                                     PType ft)
Description copied from interface: PNameCoder
In case of a naming context that supports composite names (i.e., names composed of several typed fields, whose type is limited to scalar ones), it tests if a particular field is defined by this composite name. It should be used by PClassMapping objects in order to verify, at deployment time, that naming contexts that are defined to manage the various references supports the same encoding name structure.

Specified by:
supportCompositeField in interface PNameCoder
Returns:
true if the proposed field is supported by this composite name.

supportStaticComposite

public boolean supportStaticComposite()
Description copied from interface: PNameCoder
Tests if this naming context supports comosite name through a static approach, which means that encodingAbstract/decodingAbstract use getter objects that implement specific NsFieldGetter interface generated for a particular field "Field" within a particular NameDef space "Ns".

Specified by:
supportStaticComposite in interface PNameCoder
Returns:
true if static getter is supported by composite name coding.

getPType

public PType getPType()
Description copied from interface: PNameCoder
Retrieves the PType associated to the JORM class which is the type of the name managed by this naming context.

Specified by:
getPType in interface PNameCoder
Returns:
The related PType.

setPType

public void setPType(PType pt)
Description copied from interface: PNameCoder
Assigns the PType associated to the JORM class which is the type of the name managed by this naming context.

Specified by:
setPType in interface PNameCoder
Parameters:
pt - The PType of the JORM class reference managed by this naming context.