public class IlvBeanSettings extends IlvSettings
package util; public class SaveInfo { private int autoRecover = 10; private boolean createBackupCopies = true; public int getAutoRecover() { return autoRecover; } public void setAutoRecover(int autoRecover) { this.autoRecover = autoRecover; } public boolean isCreateBackupCopies() { return createBackupCopies; } public void setCreateBackupCopies(boolean createBackupCopies) { this.createBackupCopies = createBackupCopies; } }and
package util; public class Options { private String editorPath = "..."; private SaveInfo saveInfo; public String getEditorPath() { return editorPath; } public void setEditorPath(String editorPath) { this.editorPath = editorPath; } public SaveInfo getSaveInfo() { return saveInfo; } public void setSaveInfo(SaveInfo saveInfo) { this.saveInfo = saveInfo; } }Bean settings accessing instances of those classes are defined as follows:
Options options = new Options(); IlvBeanSettings beanSettings = new IlvBeanSettings("options"); beanSettings.addControl(options); beanSettings.addControl(options, options.getSaveInfo());Those bean settings can now be accessed:
IlvSettingsElement optionsElmt = beanSettings.selectElement("util.Options"); String editorPath = optionsElmt.getString("editorPath", null); IlvSettingsElement saveInfo = optionsElmt.getFirstChild("util.SaveInfo"); boolean createBackup = saveInfo.getBoolean("createBackupCopies", true); int autoRecover = saveInfo.getInt("autoRecover", 20);
IlvSettings.AttributeID, IlvSettings.IDAttributeMapper, IlvSettings.IDResolver
APPLY_DIFF_MODE, EVERY_NODE_KEY, READABLE, SET_MODE, UNREADABLE, VERBOSE, WRITABLE
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
IlvBeanSettings(String name)
Constructs a new
IlvBeanSettings with the specified name . |
Modifier and Type | Method and Description |
---|---|
void |
addObject(Object object)
Adds the specified bean instance to the list of beans accessed by the
settings.
|
void |
addObject(Object parent,
Object object)
Adds the specified bean instance as a child of the specified parent
bean instance.
|
static PropertyDescriptor |
GetPropertyDescriptor(Class<?> beanClass,
String propertyName)
Returns the property descriptor of the property with the
propertyName of the specified beanClass . |
static PropertyDescriptor[] |
GetPropertyDescriptors(Class<?> beanClass)
Returns an array of property descriptors for the specified
beanClass . |
boolean |
removeObject(Object object)
Removes the specified
object from the list of stored bean instances. |
addIDResolver, addSettingsElement, adoptNode, appendChild, areSettingsInitialized, canWrite, cloneNode, commit, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createModel, createProcessingInstruction, createSettingsElement, createTextNode, ensureCorrespondingElement, ensureSettingsElement, ensureSettingsElement, getAccessRights, getApplication, getAttributes, getBaseURI, getCascadingMode, getChildNodes, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getFirstChild, getID, getID, getImplementation, getInputEncoding, getLastChild, getLocalName, getModel, getMutableModel, getName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSettingsManager, getStrictErrorChecking, getTextContent, getUserData, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttributes, hasChildNodes, importNode, initializeSettings, insertBefore, isDefaultNamespace, isEqualNode, IsEveryNodeKey, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, normalizeDocument, removeAllSettingsElements, removeChild, removeIDResolver, removeSettingsElement, renameNode, replaceChild, select, select, select, selectElement, selectElement, selectElement, selectNodes, setAccessRights, setApplication, setCascadingMode, setDocumentURI, setID, setModel, setName, setNodeValue, setPrefix, setSettingsManager, setStrictErrorChecking, setTextContent, setUserData, setXmlStandalone, setXmlVersion
public IlvBeanSettings(String name)
IlvBeanSettings
with the specified name
.name
- The name of the settings.public void addObject(Object object)
object
- The new bean instance to add.removeObject(java.lang.Object)
public void addObject(Object parent, Object object)
object
will have a
parent settings element that accesses the parent
instance.parent
- The bean instance considered to be the parent of the
specified object
.object
- The object to add as a child of the specified parent
.removeObject(java.lang.Object)
public boolean removeObject(Object object)
object
from the list of stored bean instances.object
- The object to remove.true
if the specified object can be removed
from the list of stored bean instances; false
otherwise.addObject(Object)
,
addObject(Object, Object)
public static PropertyDescriptor[] GetPropertyDescriptors(Class<?> beanClass)
beanClass
.PropertyDescriptors
describing the
editable properties supported by the specified bean class.public static PropertyDescriptor GetPropertyDescriptor(Class<?> beanClass, String propertyName)
propertyName
of the specified beanClass
.beanClass
- The Bean class to retrieve a property descriptor from.propertyName
- The name of the property to retrieve a property
descriptor from.null
if no
properties with the specified name belongs to the specified Bean class.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.