|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jpos.config.simple.SimpleEntry
This is a simple implementation of the JposEntry interface using a Hashtable to collect the properties
Inner Class Summary | |
static class |
SimpleEntry.Prop
Inner class to represent a property of a JposEntry |
Inner classes inherited from class jpos.config.JposEntry |
JposEntry.Prop |
Field Summary | |
static long |
serialVersionUID
serialVersionUID constant to maintain serialization compatibility between releases |
Fields inherited from interface jpos.config.JposEntry |
DEVICE_CATEGORY_PROP_NAME, JPOS_VERSION_PROP_NAME, LOGICAL_NAME_PROP_NAME, PRODUCT_DESCRIPTION_PROP_NAME, PRODUCT_NAME_PROP_NAME, PRODUCT_URL_PROP_NAME, SERVICE_CLASS_PROP_NAME, SI_FACTORY_CLASS_PROP_NAME, VENDOR_NAME_PROP_NAME, VENDOR_URL_PROP_NAME |
Constructor Summary | |
|
SimpleEntry()
Default ctor (sets the JposRegPopulator to null) |
|
SimpleEntry(JposRegPopulator populator)
One argument ctor taking the JposRegPopulator for this entry |
(package private) |
SimpleEntry(java.lang.String logicalName)
One argument ctor taking the LogicalName this entry |
|
SimpleEntry(java.lang.String logicalName,
JposRegPopulator populator)
One argument ctor taking the JposRegPopulator for this entry |
Method Summary | |
void |
add(JposEntry.Prop prop)
Adds a new property |
java.lang.Object |
addProperty(java.lang.String propName,
java.lang.Object propValue)
Adds a property to the JposEntry object. |
protected static void |
checkNull(java.lang.Object object)
Checks that the Object argument is not null and if it is throw a IllegalArgumentException |
int |
compareTo(java.lang.Object other)
|
JposEntry |
copy()
|
JposEntry.Prop |
createProp(java.lang.String propName,
java.lang.Object propValue,
java.lang.Class propType)
|
boolean |
equals(JposEntry otherEntry)
|
boolean |
equals(java.lang.Object object)
|
java.lang.String |
getLogicalName()
|
JposEntry.Prop |
getProp(java.lang.String propName)
Returns a JposEntry.Prop with name specified. |
int |
getPropertyCount()
|
java.util.Enumeration |
getPropertyNames()
|
java.lang.Class |
getPropertyType(java.lang.String propName)
|
java.lang.Object |
getPropertyValue(java.lang.String propName)
|
java.util.Iterator |
getProps()
Returns an Iterator of JposEntry.Prop in this entry |
JposRegPopulator |
getRegPopulator()
|
boolean |
hasProp(JposEntry.Prop prop)
|
boolean |
hasPropertyWithName(java.lang.String propName)
|
boolean |
hasPropertyWithValue(java.lang.Object propValue)
|
void |
modify(JposEntry.Prop prop)
Modifies the property with name of property passed with the new value if that property currently exist in the entry otherwise does nothing |
java.lang.Object |
modifyPropertyValue(java.lang.String propName,
java.lang.Object propValue)
Modifies the property value of the property passed |
void |
remove(JposEntry.Prop prop)
Removes the property |
java.lang.Object |
removeProperty(java.lang.String propName)
Looks for a property with name specified and removes it. |
(package private) void |
setRegPopulator(JposRegPopulator populator)
Sets the JposRegPopulator that loads/saves this entry. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final long serialVersionUID
Constructor Detail |
public SimpleEntry()
public SimpleEntry(JposRegPopulator populator)
populator
- the JposRegPopulator for this entrypublic SimpleEntry(java.lang.String logicalName, JposRegPopulator populator)
logicalName
- the logical name for this entrypopulator
- the JposRegPopulator for this entrySimpleEntry(java.lang.String logicalName)
logicalName
- the logical name string for this entryMethod Detail |
public int getPropertyCount()
getPropertyCount
in interface JposEntry
public java.util.Enumeration getPropertyNames()
getPropertyNames
in interface JposEntry
public boolean hasPropertyWithName(java.lang.String propName)
hasPropertyWithName
in interface JposEntry
propName
- the property name Stringpublic boolean hasPropertyWithValue(java.lang.Object propValue)
hasPropertyWithValue
in interface JposEntry
propValue
- the property's value Objectpublic java.lang.Object getPropertyValue(java.lang.String propName)
getPropertyValue
in interface JposEntry
propName
- the property's propName Stringpublic java.lang.Class getPropertyType(java.lang.String propName)
getPropertyType
in interface JposEntry
propName
- the property's name Stringpublic java.lang.Object modifyPropertyValue(java.lang.String propName, java.lang.Object propValue) throws java.lang.IllegalArgumentException
modifyPropertyValue
in interface JposEntry
propName
- the property namepropValue
- the new property valuejava.lang.IllegalArgumentException
- if the propName or propValue is nullpublic java.lang.Object addProperty(java.lang.String propName, java.lang.Object propValue) throws java.lang.IllegalArgumentException
addProperty
in interface JposEntry
propName
- the name of this property (should be unique per property)propValue
- the properties value Objectjava.lang.IllegalArgumentException
- if the propName or propValue is nullpublic java.lang.Object removeProperty(java.lang.String propName)
removeProperty
in interface JposEntry
propName
- the name String of the property to removepublic boolean equals(JposEntry otherEntry)
equals
in interface JposEntry
public JposEntry copy()
public JposRegPopulator getRegPopulator()
getRegPopulator
in interface JposEntry
public java.lang.String getLogicalName()
getLogicalName
in interface JposEntry
JposEntry.getPropertyValue(java.lang.String)
,
JposEntry.LOGICAL_NAME_PROP_NAME
public JposEntry.Prop getProp(java.lang.String propName)
JposEntry
Changes to that property object are not reflected in this entry. You must apply the changes to the property to the entry by calling modifyProp() method
getProp
in interface JposEntry
propName
- the property namepublic java.util.Iterator getProps()
JposEntry
Changes to any of the returned property object are not reflected in this entry. You must apply the changes to the property to the entry by calling modifyProp() method
getProps
in interface JposEntry
public void add(JposEntry.Prop prop) throws java.lang.IllegalArgumentException
add
in interface JposEntry
prop
- the JposEntry.Prop to addjava.lang.IllegalArgumentException
- if the argument is nullpublic void remove(JposEntry.Prop prop)
remove
in interface JposEntry
prop
- the JposEntry.Prop to removepublic void modify(JposEntry.Prop prop) throws java.lang.IllegalArgumentException
modify
in interface JposEntry
prop
- the JposEntry.Prop to modifyjava.lang.IllegalArgumentException
- if the prop is nullpublic boolean hasProp(JposEntry.Prop prop)
hasProp
in interface JposEntry
prop
- the JposEntry.Prop to check forpublic JposEntry.Prop createProp(java.lang.String propName, java.lang.Object propValue, java.lang.Class propType) throws JposConfigException
createProp
in interface JposEntry
propName
- the property namepropValue
- the property valuepropType
- the property type (valid for this value)JposConfigException
- if any of the argument is null or the
property value and type mismatch or this is not a valid property typeJposEntryConst.PROP_TYPES
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
otherEntry
- the other JposEntrypublic java.lang.String toString()
toString
in class java.lang.Object
void setRegPopulator(JposRegPopulator populator)
protected static void checkNull(java.lang.Object object) throws java.lang.IllegalArgumentException
object
- the Object argumentjava.lang.IllegalArgumentException
- if the object is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |