|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jorm.naming.lib.BasicPNamingContext
org.objectweb.jorm.naming.lib.AbstractInheritKeyFilteredPNamingContext
This class is a PNamingContext for managing the inheritance. The naming is based on a single filter (Medor expression) for the overall inheritance tree. The medor expression uses naming fields from a PNameGetter. The evalution of the expression on a PNameGetter produces a value. Each non abstract persistent class must define a key value. The comparaison between key values associated to persistent classes and the result of the expression, permits to know the persistent class represented by the PNameGetter. By this way this PNamingContext can delegate the decoding to the binder of the persistent class. This class is abstract. It must be specialized for the evalution of expression.
KFPNCGenerator
Field Summary | |
protected int |
codingType
The codingType of the current PNamingContext |
protected PType |
expressionType
The PType of the expression which is also the PType of the key of course. |
protected java.util.Map |
key2binder
The map mainting the association between keys and binder |
protected PName |
nullPName
|
protected java.lang.Object |
nullValue
An object representing the null pname value. |
protected PNameGetterConverter |
pngConverter
The PNameGetterConvert to use to convert a primitive value to a PNameGetter. |
Fields inherited from class org.objectweb.jorm.naming.lib.BasicPNamingContext |
ptype |
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 | |
AbstractInheritKeyFilteredPNamingContext()
Builds a PNamingContext. |
|
AbstractInheritKeyFilteredPNamingContext(PType expressionType,
int codingType)
|
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. |
java.util.Map |
entries()
|
abstract java.lang.Object |
evaluate(java.lang.Object png,
java.lang.Object ctx)
Evaluate the Expression/filter on a PNameGetter |
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. |
void |
exportClass(PBinder binder,
java.lang.Object key)
Export a new persistent class into this PNamingContext |
PType |
getExpressionType()
|
PName |
getNull()
It yields a "null" representation of a name within this naming context. |
void |
init()
|
boolean |
isNull(java.lang.Object png,
java.lang.Object ctx)
|
PBinder |
lookup(java.lang.Object key)
|
PName |
resolve(java.lang.Object conn,
PName pn)
It retrieves the information item associated to the given PName (if any exists). |
void |
setCodingType(int codingType)
|
void |
setExpressionType(PType type)
|
void |
setNullPName(java.lang.Object o)
It assignes a object which defines a null representation of a name within this naming context. |
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). |
void |
unexportClass(java.lang.Object key)
Unexport a persistent class from this PNamingContext |
Methods inherited from class org.objectweb.jorm.naming.lib.BasicPNamingContext |
getPType, setPType, supportCompositeField, supportDynamicComposite, supportStaticComposite |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.jorm.naming.api.PNameCoder |
getPType, setPType, supportCompositeField, supportDynamicComposite, supportStaticComposite |
Field Detail |
protected PType expressionType
protected PNameGetterConverter pngConverter
protected java.util.Map key2binder
protected int codingType
protected java.lang.Object nullValue
protected PName nullPName
Constructor Detail |
public AbstractInheritKeyFilteredPNamingContext()
public AbstractInheritKeyFilteredPNamingContext(PType expressionType, int codingType) throws PException
Method Detail |
public void init() throws PException
PException
public void setCodingType(int codingType)
public boolean isNull(java.lang.Object png, java.lang.Object ctx) throws PException
PException
public void exportClass(PBinder binder, java.lang.Object key) throws PException
KeyFilteredNamingContext
exportClass
in interface KeyFilteredNamingContext
binder
- is the PBinder instance of the persistent classkey
- is the key value permitting to identify the persistent class
PException
public void unexportClass(java.lang.Object key) throws PException
KeyFilteredNamingContext
unexportClass
in interface KeyFilteredNamingContext
key
- is the key value permitting to identify the persistent class
PException
public PBinder lookup(java.lang.Object key)
lookup
in interface KeyFilteredNamingContext
key
- is the persistent class identifier
public java.util.Map entries()
entries
in interface KeyFilteredNamingContext
public void setExpressionType(PType type)
setExpressionType
in interface KeyFilteredNamingContext
public PType getExpressionType()
getExpressionType
in interface KeyFilteredNamingContext
public abstract java.lang.Object evaluate(java.lang.Object png, java.lang.Object ctx) throws PException
KeyFilteredNamingContext
evaluate
in interface KeyFilteredNamingContext
png
- is a PNameGetter permitting to fill the expression parameters
PException
public PName resolve(java.lang.Object conn, PName pn) throws PException
PNamingContext
resolve
in interface PNamingContext
conn
- The connection that can be used to access the data store.pn
- The PName to be looked up.
PException
public PName export(java.lang.Object conn, java.lang.Object infoitem) throws PException
PNameManager
export
in interface PNameManager
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.
PName
associated to the given information
item.
PException
public PName export(java.lang.Object conn, java.lang.Object infoitem, java.lang.Object hints) throws PException
PNameManager
export
in interface PNameManager
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.
PName
associated to the given information
item.
PException
public void unexport(java.lang.Object conn, PName pn) throws PException
PNameManager
unexport
in interface PNameManager
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.
PException
public void unexport(java.lang.Object conn, PName pn, java.lang.Object hints) throws PException
PNameManager
unexport
in interface PNameManager
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.
PException
public boolean codingSupported(int codingtype)
PNameCoder
codingSupported
in interface PNameCoder
codingSupported
in class BasicPNamingContext
public PName decodeAbstract(java.lang.Object en, java.lang.Object context) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeAbstract
in interface PNameCoder
decodeAbstract
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeByte(byte en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeByte
in interface PNameCoder
decodeByte
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeObyte(java.lang.Byte en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeObyte
in interface PNameCoder
decodeObyte
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeChar(char en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeChar
in interface PNameCoder
decodeChar
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeOchar(java.lang.Character en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeOchar
in interface PNameCoder
decodeOchar
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeInt(int en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeInt
in interface PNameCoder
decodeInt
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeOint(java.lang.Integer en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeOint
in interface PNameCoder
decodeOint
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeLong(long en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeLong
in interface PNameCoder
decodeLong
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeOlong(java.lang.Long en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeOlong
in interface PNameCoder
decodeOlong
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeShort(short en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeShort
in interface PNameCoder
decodeShort
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeOshort(java.lang.Short en) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
decodeOshort
in interface PNameCoder
decodeOshort
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public PName decodeCharArray(char[] en) throws PExceptionNaming
PNameCoder
decodeCharArray
in interface PNameCoder
decodeCharArray
in class BasicPNamingContext
PExceptionNaming
public PName decode(byte[] en) throws PExceptionNaming
PNameCoder
decode
in interface PNameCoder
decode
in class BasicPNamingContext
PExceptionNaming
public PName decodeDate(java.util.Date en) throws PExceptionNaming
PNameCoder
decodeDate
in interface PNameCoder
decodeDate
in class BasicPNamingContext
PExceptionNaming
public PName decodeBigInteger(java.math.BigInteger en) throws PExceptionNaming
PNameCoder
decodeBigInteger
in interface PNameCoder
decodeBigInteger
in class BasicPNamingContext
PExceptionNaming
public PName decodeBigDecimal(java.math.BigDecimal en) throws PExceptionNaming
PNameCoder
decodeBigDecimal
in interface PNameCoder
decodeBigDecimal
in class BasicPNamingContext
PExceptionNaming
public PName decodeString(java.lang.String en) throws PExceptionNaming
PNameCoder
decodeString
in interface PNameCoder
en
- The String to be decoded.
PExceptionNaming
public byte encodeByte(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeByte
in interface PNameCoder
encodeByte
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public char encodeChar(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeChar
in interface PNameCoder
encodeChar
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public int encodeInt(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeInt
in interface PNameCoder
encodeInt
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public long encodeLong(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeLong
in interface PNameCoder
encodeLong
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public short encodeShort(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeShort
in interface PNameCoder
encodeShort
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public java.lang.Byte encodeObyte(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeObyte
in interface PNameCoder
encodeObyte
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public java.lang.Character encodeOchar(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeOchar
in interface PNameCoder
encodeOchar
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public java.lang.Integer encodeOint(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeOint
in interface PNameCoder
encodeOint
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public java.lang.Long encodeOlong(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeOlong
in interface PNameCoder
encodeOlong
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public java.lang.Short encodeOshort(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeOshort
in interface PNameCoder
encodeOshort
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public java.util.Date encodeDate(PName pn) throws PExceptionNaming
PNameCoder
encodeDate
in interface PNameCoder
encodeDate
in class BasicPNamingContext
PExceptionNaming
public java.math.BigInteger encodeBigInteger(PName pn) throws PExceptionNaming
PNameCoder
encodeBigInteger
in interface PNameCoder
encodeBigInteger
in class BasicPNamingContext
PExceptionNaming
public java.math.BigDecimal encodeBigDecimal(PName pn) throws PExceptionNaming
PNameCoder
encodeBigDecimal
in interface PNameCoder
encodeBigDecimal
in class BasicPNamingContext
PExceptionNaming
public byte[] encode(PName pn) throws PExceptionNaming
PNameCoder
encode
in interface PNameCoder
encode
in class BasicPNamingContext
PExceptionNaming
public char[] encodeCharArray(PName pn) throws PExceptionNaming
PNameCoder
encodeCharArray
in interface PNameCoder
encodeCharArray
in class BasicPNamingContext
PExceptionNaming
public java.lang.Object encodeAbstract(PName pn) throws PExceptionNaming, java.lang.UnsupportedOperationException
PNameCoder
encodeAbstract
in interface PNameCoder
encodeAbstract
in class BasicPNamingContext
PExceptionNaming
java.lang.UnsupportedOperationException
public java.lang.String encodeString(PName pn) throws PExceptionNaming
PNameCoder
encodeString
in interface PNameCoder
pn
- The PName to be encoded
PExceptionNaming
public PName getNull()
PNameCoder
getNull
in interface PNameCoder
public void setNullPName(java.lang.Object o) throws PException
PNameCoder
setNullPName
in interface PNameCoder
o
- must be the null PName
PException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |