|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.eng.spago.base.AbstractXMLObject
it.eng.spago.base.SourceBean
La classe SourceBean
implementa un contenitore di oggetti. Ogni
oggetto memorizzato nel contenitore è associato ad una chiave che ne consente
il recupero. Più oggetti possono essere memorizzati con la stessa chiave. Al
contenitore è associato un nome.
Il contenitore è in grado di ritornare una sua rappresentazione XML e di costruirsi a partire da uno stream XML (File, String, ...).
Un esempio d'uso è il seguente:
SourceBean inner = new SourceBean("inner"); inner.setAttribute("param1", 1); inner.setAttribute("param2", "value2"); SourceBean outer = new SourceBean("outer"); outer.setAttribute("param3", "value3"); outer.setAttribute(inner);
e la relativa rappresentazione XML è:
<OUTER param3="value3"> <INNER param1="1" param2="value2"> </INNER> </OUTER>
Per recuperare il/i valori di un attributo il servizio da invocare è del tipo:
String value2 = (String)outer.getAttribute("inner.param2");
La chiave di un attributo può sempre essere espressa con una dot-notation:
String key = "key1.key2.key3";
SourceBeanAttribute
,
Serialized FormConstructor Summary | |
SourceBean(SourceBean sourceBean)
Costruisce un SourceBean copia di sourceBean.
|
|
SourceBean(java.lang.String name)
Costruisce un SourceBean vuoto con nome name.
|
Method Summary | |
void |
clearBean()
Elimina tutto il conenuto del SourceBean .
|
void |
clearBean(java.lang.String key)
Elimina tutto il contenuto del SourceBean
corrispondente all'attributo di chiave key.
|
CloneableObject |
cloneObject()
Ritorna un CloneableObject copia non profonda dell'oggetto stesso.
|
boolean |
containsAttribute(java.lang.String key)
Ritorna true se l'oggetto sourceBean contiene almento un elemento con chiave key. |
void |
delAttribute(java.lang.String key)
Elimina tutti i valori dell'attributo con chiave key. |
void |
delCharacters()
Elimina il testo contenuto nel SourceBean .
|
void |
delCharacters(java.lang.String key)
Elimina il testo contenuto nel SourceBean corrispondente
all'attributo di chiave key.
|
void |
delContainedAttributes()
Elimina tutti gli attributi contenuti nel SourceBean .
|
void |
delContainedAttributes(java.lang.String key)
Elimina tutti gli attributi contenuti nel SourceBean
corrispondente all'attributo di chiave key.
|
static SourceBean |
fromXMLFile(java.lang.String xmlSourceBean)
Ritorna il SourceBean ottenuto dal parsing
del file xmlSourceBean.
|
static SourceBean |
fromXMLStream(org.xml.sax.InputSource stream)
Ritorna il SourceBean ottenuto dal parsing
dell'InputSource stream.
|
static SourceBean |
fromXMLString(java.lang.String xmlSourceBean)
Ritorna il SourceBean ottenuto dal parsing
della stringa xmlSourceBean.
|
java.lang.Object |
getAttribute(java.lang.String key)
Ritorna tutti i valori dell'attributo con chiave key. |
java.util.List |
getAttributeAsList(java.lang.String key)
Ritorna tutti i valori dell'attributo con chiave key. |
java.lang.Object |
getAttributeItem(java.lang.String key)
Ritorna tutti gli oggetti di tipo SourceBeanAttribute il
cui campo chiave vale key.
|
java.lang.String |
getCharacters()
Ritorna il testo contenuto nel SourceBean .
|
java.lang.String |
getCharacters(java.lang.String key)
Ritorna il testo contenuto nel SourceBean corrispondente
all'attributo di chiave key.
|
java.util.List |
getContainedAttributes()
Ritorna tutti gli oggetti di tipo SourceBeanAttribute contenuti.
|
java.util.List |
getContainedAttributes(java.lang.String key)
Ritorna tutti gli oggetti di tipo SourceBeanAttribute contenuti
nel SourceBean corrispondente all'attributo di chiave key.
|
java.util.List |
getContainedSourceBeanAttributes()
Ritorna gli oggetti di tipo SourceBeanAttribute contenuti
il cui valore associato è di tipo SourceBean .
|
java.util.List |
getContainedSourceBeanAttributes(java.lang.String key)
Ritorna gli oggetti di tipo SourceBeanAttribute contenuti
nel SourceBean corrispondente all'attributo di chiave key
ed il cui valore associato è di tipo SourceBean .
|
java.lang.Object |
getFilteredSourceBeanAttribute(java.lang.String key,
java.lang.String paramName,
java.lang.String paramValue)
Ritorna tutti i valori dell'attributo con chiave key che sono di tipo SourceBean e contengono un attributo single-value
con chiave paramName e valore paramValue.
|
java.util.List |
getFilteredSourceBeanAttributeAsList(java.lang.String key,
java.lang.String paramName,
java.lang.String paramValue)
Ritorna un List contenente tutti i valori dell'attributo con chiave key che sono di tipo SourceBean e contengono un attributo single-value
con chiave paramName e valore paramValue.
|
java.util.Vector |
getFullKeyPaths(java.lang.String key)
Ritorna il vettore di chiavi in dot-notation degli attributi a cui è associata la chiave key. |
java.lang.String |
getName()
Ritorna il nome del SourceBean .
|
void |
setAttribute(SourceBean value)
Aggiunge al SourceBean un nuovo attributo il cui valore è
un SourceBean . |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Aggiunge al SourceBean un nuovo attributo con chiave key
e valore value. |
void |
setBean(SourceBean sourceBean)
Copia tutto il contenuto del parametro SourceBean
nel proprio stato.
|
void |
setBean(java.lang.String key,
SourceBean sourceBean)
Copia il contenuto del parametro SourceBean
nel proprio stato a partire dall'attributo con chiave key.
|
void |
setCharacters(java.lang.String characters)
Sostituisce il testo contenuto con quello del parametro characters. |
void |
setCharacters(java.lang.String key,
java.lang.String characters)
Sostituisce il testo contenuto nel SourceBean corrispondente
all'attributo di chiave key con quello del parametro
characters.
|
void |
setContainedAttributes(java.util.List attributes)
Sostituisce tutti gli oggetti di tipo SourceBeanAttribute contenuti
con quelli del vettore attributes.
|
void |
setContainedAttributes(java.lang.String key,
java.util.List attributes)
Sostituisce tutti gli oggetti di tipo SourceBeanAttribute contenuti
nel SourceBean corrispondente all'attributo di chiave key
con quelli del vettore attributes.
|
org.w3c.dom.Element |
toElement(org.w3c.dom.Document document)
Ritorna un oggetto di tipo Element che verrą utilizzato nella rappresentazione in XML dell'oggetto. |
java.lang.String |
toString()
|
void |
updAttribute(SourceBean value)
|
void |
updAttribute(java.lang.String key,
java.lang.Object value)
Sostituisce il valore dell'attributo con chiave key con il nuovo valore value. |
void |
updContainedAttributes(java.util.List attributes)
|
void |
updContainedAttributes(java.lang.String key,
java.util.ArrayList attributes)
|
Methods inherited from class it.eng.spago.base.AbstractXMLObject |
toDocument, toXML, toXML, toXML, toXML |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SourceBean(java.lang.String name) throws SourceBeanException
SourceBean
vuoto con nome name.
name
- nome del SourceBean
SourceBeanException
- viene lanciata se il parametro di input
name non è una nome validoSourceBean(SourceBean)
public SourceBean(SourceBean sourceBean) throws SourceBeanException
SourceBean
copia di sourceBean.
sourceBean
- SourceBean
da copiare
SourceBeanException
- viene lanciata se il parametro di input
sourceBean è nulloSourceBean(String)
Method Detail |
public CloneableObject cloneObject()
CloneableObject
copia non profonda dell'oggetto stesso.
cloneObject
in interface CloneableObject
SourceBean
stessopublic void clearBean()
SourceBean
.
clearBean(String)
public void clearBean(java.lang.String key)
SourceBean
corrispondente all'attributo di chiave key.
key
- chiave dell'attributo in dot-notationclearBean()
public void setBean(SourceBean sourceBean)
SourceBean
nel proprio stato.
sourceBean
- SourceBean
di riferimento.public void setBean(java.lang.String key, SourceBean sourceBean) throws SourceBeanException
SourceBean
nel proprio stato a partire dall'attributo con chiave key.
key
- String
key che identifica un elemento del sourceBean.sourceBean
- SourceBean
di riferimento.
SourceBeanException
- viene lanciata se la chiave non fa riferimento a nessun elemento.public java.lang.String getName()
SourceBean
.
SourceBean
SourceBean(String)
public java.lang.Object getAttributeItem(java.lang.String key)
SourceBeanAttribute
il
cui campo chiave vale key.
key
- chiave dell'attributo in dot-notation
SourceBeanAttribute
corrispondente alla chiave se
l'attributo è single-value
SourceBeanAttribute
corrispondenti
alla chiave se l'attributo è multi-value
getAttribute(String)
public boolean containsAttribute(java.lang.String key)
key
- chiave dell'attributo in dot-notation
public java.lang.Object getAttribute(java.lang.String key)
key
- chiave dell'attributo in dot-notation
setAttribute(String, Object)
,
setAttribute(SourceBean)
,
updAttribute(String, Object)
,
delAttribute(String)
public java.util.List getAttributeAsList(java.lang.String key)
key
- chiave dell'attributo in dot-notation
setAttribute(String, Object)
,
setAttribute(SourceBean)
,
updAttribute(String, Object)
,
delAttribute(String)
public void setAttribute(java.lang.String key, java.lang.Object value) throws SourceBeanException
SourceBean
un nuovo attributo con chiave key
e valore value. Se il valore dell'attributo è un SourceBean
il servizio è equivalente a:
SourceBean keySourceBean = new SourceBean(key); keySourceBean.setAttribute(value); this.setAttribute(keySourceBean);
key
- chiave dell'attributo in dot-notationvalue
- valore dell'attributo
SourceBeanException
- viene lanciata in tutti i casi in cui la chiave
espressa in dot-notation non sia correttagetAttribute(String)
,
setAttribute(SourceBean)
,
updAttribute(String, Object)
,
delAttribute(String)
public void setAttribute(SourceBean value) throws SourceBeanException
SourceBean
un nuovo attributo il cui valore è
un SourceBean
. La chiave con cui il secondo SourceBean
viene aggiunto è pari al nome del contenitore stesso.
value
- SourceBean
da aggiungere
SourceBeanException
- viene lanciata se value è
nullgetAttribute(String)
,
setAttribute(String, Object)
,
updAttribute(String, Object)
,
delAttribute(String)
public void updAttribute(java.lang.String key, java.lang.Object value) throws SourceBeanException
SourceBeanException
.
key
- chiave dell'attributo in dot-notationvalue
- valore dell'attributo
SourceBeanException
- viene lanciata in tutti i casi in cui la chiave
espressa in dot-notation non sia correttagetAttribute(String)
,
setAttribute(String, Object)
,
setAttribute(SourceBean)
,
delAttribute(String)
public void updAttribute(SourceBean value) throws SourceBeanException
SourceBeanException
public void delAttribute(java.lang.String key) throws SourceBeanException
key
- chiave dell'attributo in dot-notation
SourceBeanException
- viene lanciata in tutti i casi in cui la chiave
espressa in dot-notation non sia correttagetAttribute(String)
,
setAttribute(String, Object)
,
setAttribute(SourceBean)
,
updAttribute(String, Object)
public java.lang.String getCharacters()
SourceBean
.
getCharacters(String)
,
setCharacters(String)
,
setCharacters(String, String)
,
delCharacters()
,
delCharacters(String)
public java.lang.String getCharacters(java.lang.String key)
SourceBean
corrispondente
all'attributo di chiave key.
key
- chiave dell'attributo in dot-notation
getCharacters()
,
setCharacters(String)
,
setCharacters(String, String)
,
delCharacters()
,
delCharacters(String)
public void setCharacters(java.lang.String characters)
characters
- il nuovo testogetCharacters(String)
,
SourceBean#getCharacters(String, String)
,
setCharacters(String, String)
,
delCharacters()
,
delCharacters(String)
public void setCharacters(java.lang.String key, java.lang.String characters) throws SourceBeanException
SourceBean
corrispondente
all'attributo di chiave key con quello del parametro
characters.
key
- chiave dell'attributo in dot-notationcharacters
- il nuovo testo
SourceBeanException
getCharacters(String)
,
SourceBean#getCharacters(String, String)
,
setCharacters(String)
,
delCharacters()
,
delCharacters(String)
public void delCharacters()
SourceBean
.
getCharacters()
,
getCharacters(String)
,
setCharacters(String)
,
setCharacters(String, String)
,
delCharacters(String)
public void delCharacters(java.lang.String key)
SourceBean
corrispondente
all'attributo di chiave key.
key
- chiave dell'attributo in dot-notationgetCharacters()
,
getCharacters(String)
,
setCharacters(String)
,
setCharacters(String, String)
,
delCharacters()
public java.util.List getFilteredSourceBeanAttributeAsList(java.lang.String key, java.lang.String paramName, java.lang.String paramValue)
SourceBean
e contengono un attributo single-value
con chiave paramName e valore paramValue.
key
- chiave dell'attributo in dot-notationparamName
- nome del parametro di filtroparamValue
- valore del parametro di filtro
SourceBean
se più valori
vengono trovati
getAttribute(String)
public java.lang.Object getFilteredSourceBeanAttribute(java.lang.String key, java.lang.String paramName, java.lang.String paramValue)
SourceBean
e contengono un attributo single-value
con chiave paramName e valore paramValue.
key
- chiave dell'attributo in dot-notationparamName
- nome del parametro di filtroparamValue
- valore del parametro di filtro
SourceBean
se un solo valore viene trovato
SourceBean
se più valori
vengono trovati
getAttribute(String)
public java.util.List getContainedAttributes()
SourceBeanAttribute
contenuti.
List
arraylist di SourceBeanAttribute
contenutigetContainedAttributes(String)
,
setContainedAttributes(List)
,
setContainedAttributes(String, List)
,
delContainedAttributes()
,
delContainedAttributes(String)
public java.util.List getContainedAttributes(java.lang.String key)
SourceBeanAttribute
contenuti
nel SourceBean
corrispondente all'attributo di chiave key.
key
- chiave dell'attributo in dot-notation
List
list di SourceBeanAttribute
contenutigetContainedAttributes()
,
setContainedAttributes(List)
,
setContainedAttributes(String, List)
,
delContainedAttributes()
,
delContainedAttributes(String)
public void setContainedAttributes(java.util.List attributes)
SourceBeanAttribute
contenuti
con quelli del vettore attributes.
attributes
- List
list
SourceBeanAttribute
dei nuovi attributigetContainedAttributes()
,
getContainedAttributes(String)
,
setContainedAttributes(String, List)
,
delContainedAttributes()
,
delContainedAttributes(String)
public void setContainedAttributes(java.lang.String key, java.util.List attributes) throws SourceBeanException
SourceBeanAttribute
contenuti
nel SourceBean
corrispondente all'attributo di chiave key
con quelli del vettore attributes.
attributes
- List
list di
SourceBeanAttribute
dei nuovi attributi
SourceBeanException
getContainedAttributes()
,
getContainedAttributes(String)
,
setContainedAttributes(List)
,
delContainedAttributes()
,
delContainedAttributes(String)
public void updContainedAttributes(java.util.List attributes) throws SourceBeanException
SourceBeanException
public void updContainedAttributes(java.lang.String key, java.util.ArrayList attributes) throws SourceBeanException
SourceBeanException
public void delContainedAttributes()
SourceBean
.
getContainedAttributes()
,
getContainedAttributes(String)
,
setContainedAttributes(List)
,
setContainedAttributes(String, List)
,
delContainedAttributes(String)
public void delContainedAttributes(java.lang.String key)
SourceBean
corrispondente all'attributo di chiave key.
key
- chiave dell'attributo in dot-notationgetContainedAttributes()
,
getContainedAttributes(String)
,
setContainedAttributes(List)
,
setContainedAttributes(String, List)
,
delContainedAttributes()
public java.util.List getContainedSourceBeanAttributes()
SourceBeanAttribute
contenuti
il cui valore associato è di tipo SourceBean
.
List
arrayList di SourceBeanAttribute
getContainedSourceBeanAttributes(String)
,
getContainedAttributes()
,
getContainedAttributes(String)
public java.util.List getContainedSourceBeanAttributes(java.lang.String key)
SourceBeanAttribute
contenuti
nel SourceBean
corrispondente all'attributo di chiave key
ed il cui valore associato è di tipo SourceBean
.
key
- chiave dell'attributo in dot-notation
List
il vettore di SourceBeanAttribute
getContainedSourceBeanAttributes()
,
getContainedAttributes()
,
getContainedAttributes(String)
public java.util.Vector getFullKeyPaths(java.lang.String key)
key
- chiave dell'attributo non in dot-notation
List
il vettore di chiavi in dot-notationpublic static SourceBean fromXMLStream(org.xml.sax.InputSource stream) throws SourceBeanException
SourceBean
ottenuto dal parsing
dell'InputSource
stream.
stream
- rappresentazione XML del SourceBean
SourceBean
corrispondente allo stream XML
SourceBeanException
fromXMLString(String)
,
fromXMLFile(String)
public static SourceBean fromXMLString(java.lang.String xmlSourceBean) throws SourceBeanException
SourceBean
ottenuto dal parsing
della stringa xmlSourceBean.
xmlSourceBean
- rappresentazione XML del SourceBean
SourceBean
corrispondente allo stream XML
SourceBeanException
fromXMLStream(InputSource)
,
fromXMLFile(String)
public static SourceBean fromXMLFile(java.lang.String xmlSourceBean) throws SourceBeanException
SourceBean
ottenuto dal parsing
del file xmlSourceBean.
xmlSourceBean
- nome del file che contiene la rappresentazione XML
del SourceBean
SourceBean
corrispondente allo stream XML
SourceBeanException
fromXMLStream(InputSource)
,
fromXMLString(String)
public org.w3c.dom.Element toElement(org.w3c.dom.Document document)
toElement
in interface XMLObject
Document un oggetto di tipo Document.
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |