|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable
org.productivity.java.habitat4j.common.PropertyList
public class PropertyList
This class provides name/value pair Hashtables for property lists maintained by Habitat4J. Access directly to a PropertyList is not typical - the getters and setters in PropertyListManager are used instead.
## LICENSE INFORMATION ##
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
| Field Summary | |
|---|---|
static java.lang.Class[] |
emptyClassArray
|
static java.lang.Object[] |
emptyObjectArray
|
protected Habitat4JLogger |
logger
|
static java.lang.Class[] |
singleCharClassArray
|
static java.lang.Class[] |
singleStringClassArray
|
| Constructor Summary | |
|---|---|
PropertyList(java.lang.String listName,
java.util.Hashtable globalPropertyBeanDefinitions,
java.util.Hashtable globalDecoderDefinitions,
java.util.Hashtable globalDecryptorDefinitions,
java.lang.Object globalReloadEventHandler)
|
|
| Method Summary | |
|---|---|
void |
addDecoderDefinition(java.lang.String id,
java.lang.Object object)
This method handles the addition of a Decoder definition. |
void |
addDecryptionDefinition(java.lang.String id,
java.lang.Object object)
This method handles the addition of a Decryptor definition. |
void |
addPropertyBeanCopyMethodDefinition(java.lang.Class clazz,
java.lang.String cloneMethodType)
This method handles the addition of a PropertyBean copyMethod definition. |
void |
addPropertyBeanDefinition(java.lang.String id,
java.lang.Object object)
This method handles the addition of a PropertyBean definition. |
protected void |
checkThatPropertyExists(java.lang.String name)
|
protected java.lang.Object |
cloneObject(java.lang.Object object,
java.lang.String methodName)
|
protected java.util.HashSet |
convertPropertyHashtableToHashSet(PropertyHash table)
|
void |
flagDecodedProperty(java.lang.String name)
This method sets the flag that indicates a property was decoded at load time. |
void |
flagDecryptedProperty(java.lang.String name)
This method sets the flag that indicates a property was decrypted at load time. |
static long |
getCurrentLastModified(java.lang.String fileName)
|
DecoderIF |
getDecoderInstance(java.lang.String appName,
java.lang.String id)
|
DecryptorIF |
getDecryptorInstance(java.lang.String appName,
java.lang.String id)
|
java.lang.String |
getListModifiedBy()
|
java.lang.String |
getListName()
|
int |
getListReloadSerial()
|
java.lang.String |
getListVersion()
|
java.lang.Object |
getNewPropertyBeanInstance(java.lang.String id)
|
java.lang.String |
getPragmaDefinition(java.lang.String name)
This method handles the retrieval of a PropertyList-local pragma definition. |
java.util.Hashtable |
getPragmaDefinitions()
|
java.util.Enumeration |
getProperties()
This method returns an Enumeration of all property names. |
java.lang.String |
getProperty(java.lang.String name)
This method gets a property consisting of a String value. |
java.lang.String[] |
getPropertyArray(java.lang.String name)
This method gets a property consisting of an array of String values. |
int |
getPropertyAsInt(java.lang.String name)
|
java.lang.Object |
getPropertyBean(java.lang.String name,
boolean returnCopy)
This method gets a property consisting of a PropertyBean. |
java.lang.Object[] |
getPropertyBeanArray(java.lang.String name,
boolean returnCopy)
This method gets a property consisting of an array of PropertyBean Objects. |
protected PropertyBeanArrayVector |
getPropertyBeanArrayCopy(PropertyBeanArrayVector vector)
|
protected java.lang.Object |
getPropertyBeanCopy(java.lang.Object bean)
|
protected java.lang.Object |
getPropertyBeanCopyViaReflection(java.lang.Object bean)
|
protected java.lang.Object |
getPropertyBeanCopyViaSerialization(java.lang.Object bean)
getPropertyBeanCopyViaSerialization(Object) uses serialization to copy (clone) an Object. |
PropertyBeanHash |
getPropertyBeanHash(java.lang.String name,
boolean returnCopy)
This method gets a property consisting of an array of PropertyBean Objects. |
protected PropertyBeanHash |
getPropertyBeanHashCopy(PropertyBeanHash hash)
|
java.lang.Object |
getPropertyBeanHashValue(java.lang.String name,
java.lang.String value,
boolean returnCopy)
This method gets a property consisting of an array of PropertyBean Objects. |
java.lang.Class |
getPropertyClass(java.lang.String name)
This method gets a property's class. |
java.lang.String |
getPropertyClassName(java.lang.String name)
This method gets a property's classname. |
PropertyHash |
getPropertyHash(java.lang.String name)
This method gets a property consisting of a hash of String values. |
java.util.HashSet |
getPropertyHashSet(java.lang.String name)
This method gets a property consisting of a hash of String values. |
java.lang.String |
getPropertyHashValue(java.lang.String name,
java.lang.String key)
This method gets a keyed property from a hash of String values. |
long |
getPropertyListFileLastLoaded()
|
long |
getPropertyListFileLastModified()
|
java.lang.String |
getPropertyListFilePath()
|
ReloadEventHandlerIF |
getReloadDefinitionInstance()
|
java.lang.Object |
getReloadEventHandler()
|
int |
getToStringItemsPerLine()
|
boolean |
hasReloadEventHandler()
|
boolean |
isDecodedProperty(java.lang.String name)
|
boolean |
isDecoderIdValid(java.lang.String id)
This method is used to determine whether a Decoder identifier is valid. |
boolean |
isDecryptedProperty(java.lang.String name)
|
boolean |
isDecryptorIdValid(java.lang.String id)
This method is used to determine whether a Decryptor identifier is valid. |
boolean |
isPropertyABean(java.lang.String name)
This method is used to determine whether a property contains an implementation of the Object interface. |
boolean |
isPropertyABeanArray(java.lang.String name)
This method returns whether a property contains an array of PropertyBean Objects. |
boolean |
isPropertyABeanHash(java.lang.String name)
This method returns whether a property contains a hash of PropertyBean Objects. |
boolean |
isPropertyAHash(java.lang.String name)
This method returns whether a property contains a hash of Strings. |
boolean |
isPropertyAnArray(java.lang.String name)
This method returns whether a property contains an array of Strings. |
boolean |
isPropertyAString(java.lang.String name)
This method returns whether a property contains a String (name/value pair). |
boolean |
isPropertyBeanIdValid(java.lang.String id)
This method is used to determine whether a PropertyBean identifier is valid. |
boolean |
isPropertyHashValue(java.lang.String name,
java.lang.String key)
This method gets a keyed property from a hash of String values. |
boolean |
isPropertyTrue(java.lang.String name)
|
boolean |
isReloadable()
|
boolean |
isReloadBlock()
|
boolean |
isShouldCopyCloneableObjects()
|
boolean |
isShouldCopyStringObjects()
|
boolean |
isShouldCopyWrapperObjects()
|
boolean |
isShouldSuppressPropertyBeanCopyWarnings()
|
void |
setListModifiedBy(java.lang.String listModifiedBy)
|
void |
setListName(java.lang.String listName)
|
void |
setListReloadSerial(int listReloadSerial)
|
void |
setListVersion(java.lang.String listVersion)
|
void |
setPragmaDefinition(java.lang.String name,
java.lang.String value)
This method handles the setting of a PropertyList-local pragma definition. |
void |
setProperty(java.lang.String name,
java.lang.String value)
This method sets a property name/value pair. |
void |
setPropertyListFileLastLoaded(long propertyListFileLastLoaded)
|
void |
setPropertyListFileLastModified(long propertyListFileLastModified)
|
void |
setPropertyListFilePath(java.lang.String propertyListFilePath)
|
void |
setReloadBlock(boolean reloadBlock)
|
void |
setReloadEventHandler(java.lang.Object reloadEventHandler)
|
void |
setShouldCopyCloneableObjects(boolean shouldCopyCloneableObjects)
|
void |
setShouldCopyStringObjects(boolean shouldCopyStringObjects)
|
void |
setShouldCopyWrapperObjects(boolean shouldCopyWrapperObjects)
|
void |
setShouldSuppressPropertyBeanCopyWarnings(boolean shouldSuppressPropertyBeanCopyWarnings)
|
void |
setToStringItemsPerLine(int toStringItemsPerLine)
|
boolean |
shouldReload()
|
protected void |
throwPropertyNotAvailableException(java.lang.String name,
java.lang.String reason)
|
protected void |
throwPropertyNotAvailableExceptionForBadType(java.lang.String name,
java.lang.String correctType)
|
java.lang.String |
toString()
This method provides a human-readable dump of all properties, but will NOT display any values that were decoded or decrypted at load time. |
| Methods inherited from class java.util.Hashtable |
|---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.Object[] emptyObjectArray
public static final java.lang.Class[] emptyClassArray
public static final java.lang.Class[] singleStringClassArray
public static final java.lang.Class[] singleCharClassArray
protected Habitat4JLogger logger
| Constructor Detail |
|---|
public PropertyList(java.lang.String listName,
java.util.Hashtable globalPropertyBeanDefinitions,
java.util.Hashtable globalDecoderDefinitions,
java.util.Hashtable globalDecryptorDefinitions,
java.lang.Object globalReloadEventHandler)
| Method Detail |
|---|
public void setProperty(java.lang.String name,
java.lang.String value)
name - - the name of the property to getvalue - - the value of the property to set
public java.lang.String getProperty(java.lang.String name)
throws PropertyNotAvailableException
name - - the name of the property to get
PropertyNotAvailableException
public int getPropertyAsInt(java.lang.String name)
throws PropertyNotAvailableException
name - - the name of the property to get
PropertyNotAvailableException
public boolean isPropertyTrue(java.lang.String name)
throws PropertyNotAvailableException
name - - the name of the property to get
PropertyNotAvailableException
public java.lang.String[] getPropertyArray(java.lang.String name)
throws PropertyNotAvailableException
name - - the name of the property to get
PropertyNotAvailableException
public PropertyHash getPropertyHash(java.lang.String name)
throws PropertyNotAvailableException
name - - the name of the property to get
PropertyNotAvailableException
public java.lang.String getPropertyHashValue(java.lang.String name,
java.lang.String key)
throws PropertyNotAvailableException
name - - the name of the property to getkey - - the name of the property to get
PropertyNotAvailableException
public boolean isPropertyHashValue(java.lang.String name,
java.lang.String key)
throws PropertyNotAvailableException
name - - the name of the property to getkey - - the name of the property to get
PropertyNotAvailableExceptionprotected java.util.HashSet convertPropertyHashtableToHashSet(PropertyHash table)
table - - the PropertyHashTable to convert
public java.util.HashSet getPropertyHashSet(java.lang.String name)
throws PropertyNotAvailableException
name - - the name of the property to get
PropertyNotAvailableExceptionprotected PropertyBeanArrayVector getPropertyBeanArrayCopy(PropertyBeanArrayVector vector)
vector - - the PropertyBeanArrayVector to copy (clone)
protected PropertyBeanHash getPropertyBeanHashCopy(PropertyBeanHash hash)
hash - - the PropertyBeanHash to copy (clone)
protected java.lang.Object cloneObject(java.lang.Object object,
java.lang.String methodName)
object - - the Object to clonemethodName - - the methodName to use in logging
protected java.lang.Object getPropertyBeanCopyViaReflection(java.lang.Object bean)
throws PropertyNotAvailableException
bean - - the Object instance to copy (clone)
PropertyNotAvailableException
protected java.lang.Object getPropertyBeanCopyViaSerialization(java.lang.Object bean)
throws PropertyNotAvailableException
bean - - the Object instance to copy (clone)
PropertyNotAvailableException
protected java.lang.Object getPropertyBeanCopy(java.lang.Object bean)
throws PropertyNotAvailableException
bean - - the Object instance to copy (clone)
PropertyNotAvailableException
public java.lang.Object getPropertyBean(java.lang.String name,
boolean returnCopy)
throws PropertyNotAvailableException
name - - the name of the property to getreturnCopy - - whether or not to return a copy of the PropertyBean
PropertyNotAvailableException
public java.lang.Object[] getPropertyBeanArray(java.lang.String name,
boolean returnCopy)
throws PropertyNotAvailableException
name - - the name of the propertyreturnCopy - - whether or not to return a copy of the PropertyBean array
PropertyNotAvailableException
public PropertyBeanHash getPropertyBeanHash(java.lang.String name,
boolean returnCopy)
throws PropertyNotAvailableException
name - - the name of the propertyreturnCopy - - whether or not to return a copy of the PropertyBean array
PropertyNotAvailableException
public java.lang.Object getPropertyBeanHashValue(java.lang.String name,
java.lang.String value,
boolean returnCopy)
throws PropertyNotAvailableException
name - - the name of the propertyvalue - - the key to lookup in the hashtablereturnCopy - - whether or not to return a copy of the PropertyBean array
PropertyNotAvailableException
public java.lang.Class getPropertyClass(java.lang.String name)
throws PropertyNotAvailableException
name - the name of the property for which to get the class
PropertyNotAvailableException
public java.lang.String getPropertyClassName(java.lang.String name)
throws PropertyNotAvailableException
name - the name of the property for which to get the classname
PropertyNotAvailableException
public boolean isPropertyAString(java.lang.String name)
throws PropertyNotAvailableException
name - the name of the property
PropertyNotAvailableException
public boolean isPropertyAnArray(java.lang.String name)
throws PropertyNotAvailableException
name - the name of the property
PropertyNotAvailableException
public boolean isPropertyAHash(java.lang.String name)
throws PropertyNotAvailableException
name - the name of the property
PropertyNotAvailableException
public boolean isPropertyABean(java.lang.String name)
throws PropertyNotAvailableException
name - - the name of the property
PropertyNotAvailableException
public boolean isPropertyABeanArray(java.lang.String name)
throws PropertyNotAvailableException
name - the name of the property
PropertyNotAvailableException
public boolean isPropertyABeanHash(java.lang.String name)
throws PropertyNotAvailableException
name - the name of the property
PropertyNotAvailableExceptionpublic java.util.Enumeration getProperties()
public java.lang.String getPropertyListFilePath()
public void setPropertyListFilePath(java.lang.String propertyListFilePath)
propertyListFilePath - public long getPropertyListFileLastModified()
public void setPropertyListFileLastModified(long propertyListFileLastModified)
propertyListFileLastModified - The propertyListFileLastModifiedDate to set.public boolean isReloadable()
public boolean shouldReload()
public static long getCurrentLastModified(java.lang.String fileName)
fileName -
public long getPropertyListFileLastLoaded()
public void setPropertyListFileLastLoaded(long propertyListFileLastLoaded)
propertyListFileLastLoaded - The propertyListFileLastLoaded to set.
public void addPropertyBeanDefinition(java.lang.String id,
java.lang.Object object)
id - - the identifier of the property bean definitionobject - - the Class or Object of the property bean definition
public void addPropertyBeanCopyMethodDefinition(java.lang.Class clazz,
java.lang.String cloneMethodType)
clazz - - the class of the property bean definitionbyte - - the Class or Object of the property bean definition
public void addDecoderDefinition(java.lang.String id,
java.lang.Object object)
id - - the identifier of the decoding definitionobject - - the Class or Object of the decoding definition
public void addDecryptionDefinition(java.lang.String id,
java.lang.Object object)
id - - the identifier of the decryptor definitionobject - - the Class or Object of the decryptor definition
public void setPragmaDefinition(java.lang.String name,
java.lang.String value)
name - - the name of the pragma definitionvalue - - the value of the pragma definitionpublic java.lang.String getPragmaDefinition(java.lang.String name)
name - - the name of the pragma definition
public java.util.Hashtable getPragmaDefinitions()
public boolean isPropertyBeanIdValid(java.lang.String id)
id - - the identifier of the property bean definition
public boolean isDecoderIdValid(java.lang.String id)
id - - the identifier of the decoding definition
public boolean isDecryptorIdValid(java.lang.String id)
id - - the identifier of the decryptor definition
public java.lang.Object getNewPropertyBeanInstance(java.lang.String id)
id - - the PropertyBean identifier
public DecoderIF getDecoderInstance(java.lang.String appName,
java.lang.String id)
throws DecoderException
appName - - the name of the calling applicationid - - the Decoder identifier
DecoderException
public DecryptorIF getDecryptorInstance(java.lang.String appName,
java.lang.String id)
throws DecryptorException
appName - - the name of the calling applicationid - - the Decryptor identifier
DecryptorExceptionpublic void flagDecodedProperty(java.lang.String name)
name - - the property namepublic void flagDecryptedProperty(java.lang.String name)
name - - the property namepublic boolean isDecodedProperty(java.lang.String name)
name - - the property name
public boolean isDecryptedProperty(java.lang.String name)
name -
public java.lang.String toString()
toString in class java.util.Hashtablepublic void setReloadEventHandler(java.lang.Object reloadEventHandler)
reloadEventHandler - - the reloadEventHandler to set.public java.lang.Object getReloadEventHandler()
public boolean hasReloadEventHandler()
public ReloadEventHandlerIF getReloadDefinitionInstance()
public boolean isReloadBlock()
public void setReloadBlock(boolean reloadBlock)
reloadBlock - - the reloadBlock to set.public java.lang.String getListModifiedBy()
public void setListModifiedBy(java.lang.String listModifiedBy)
listModifiedBy - - the listModifiedBy to set.public int getListReloadSerial()
public void setListReloadSerial(int listReloadSerial)
listReloadSerial - - the listReloadSerial to set.public java.lang.String getListVersion()
public void setListVersion(java.lang.String listVersion)
listVersion - - the listVersion to set.public java.lang.String getListName()
public void setListName(java.lang.String listName)
listName - - the listName to set.
protected void throwPropertyNotAvailableExceptionForBadType(java.lang.String name,
java.lang.String correctType)
throws PropertyNotAvailableException
name - - name of the Property to describe in the PropertyNotAvailableExceptioncorrectType -
PropertyNotAvailableException
protected void throwPropertyNotAvailableException(java.lang.String name,
java.lang.String reason)
throws PropertyNotAvailableException
name - - name of the Property to describe in the PropertyNotAvailableExceptionreason - - textual reason to describe in the PropertyNotAvailableException
PropertyNotAvailableException
protected void checkThatPropertyExists(java.lang.String name)
throws PropertyNotAvailableException
name - - name of the Property to describe in the PropertyNotAvailableException
PropertyNotAvailableExceptionpublic boolean isShouldCopyCloneableObjects()
public void setShouldCopyCloneableObjects(boolean shouldCopyCloneableObjects)
shouldCopyCloneableObjects - - sets whether the cloneObject() method should clone Objects implementing the Cloneable interfacepublic boolean isShouldCopyWrapperObjects()
public void setShouldCopyWrapperObjects(boolean shouldCopyWrapperObjects)
shouldCopyWrapperObjects - - sets whether the cloneObject() method should clone Wrapper Objectspublic boolean isShouldCopyStringObjects()
public void setShouldCopyStringObjects(boolean shouldCopyStringObjects)
shouldCopyStringObjects - - sets whether the cloneObject() method should clone String Objectspublic boolean isShouldSuppressPropertyBeanCopyWarnings()
public void setShouldSuppressPropertyBeanCopyWarnings(boolean shouldSuppressPropertyBeanCopyWarnings)
shouldSuppressPropertyBeanCopyWarnings - - sets whether "WARN" logging during property bean copy should be suppressedpublic int getToStringItemsPerLine()
public void setToStringItemsPerLine(int toStringItemsPerLine)
toStringItemsPerLine - - the number of toString() items per line.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||