|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.xui.data.XModel
net.xoetrope.optional.service.XServiceModelNode
public class XServiceModelNode
Models a service as a model node. Getting the node value causes the service to be invoked. The node attributes are used as the arguments for the service call.
Copyright (c) Xoetrope Ltd., 2001-2006, see license.txt for details
| Field Summary | |
|---|---|
protected ServiceProxy |
callProxy
|
protected boolean |
dirty
|
protected long |
expires
|
protected java.lang.String |
serviceId
|
| Fields inherited from class net.xoetrope.xui.data.XModel |
|---|
parentModel, tagName |
| Constructor Summary | |
|---|---|
XServiceModelNode()
Set the dirty flag to true |
|
| Method Summary | |
|---|---|
java.lang.Object |
append(java.lang.String id)
Append a new node with the specified name. |
void |
append(XModel newObject)
Append a node |
java.lang.Object |
get()
Start off the call through the route |
XModel |
get(int i)
Get the XModel at element i |
java.lang.Object |
get(ServiceContext context)
Start off the call through the route using a session context |
java.lang.String |
getAttribName(int i)
Get the name of an argument |
int |
getAttribute(java.lang.String argName)
Look up an argument name |
java.lang.Object |
getAttribValue(int idx)
Retrieve the value of the argument at the specified index |
double |
getAttribValueAsDouble(int i)
Deprecated. use getAttribValueAsDouble( i, decimalSeparator, groupingSeparator ) instead, if the locale is different from the locale used to write the values to the model, then the parsed value may be incorrect. |
double |
getAttribValueAsDouble(int i,
char decimalSeparator,
char groupingSeparator)
Convert the attribute at the specified index to a double and return it |
int |
getAttribValueAsInt(int i)
Retrieve the value of the attribute at the specified index, convert it to an int and return it. |
java.lang.String |
getAttribValueAsString(int i)
Retrieve the value of the attribute at the specified index, convert it to a String and return it. |
java.lang.String |
getId()
Retrive the serviceId |
ServiceProxy |
getServiceProxy()
Get the service proxy that implements this service call |
ServiceProxy |
getServiceProxy(java.lang.String reqdClass)
Get the service proxy that implements this service call |
int |
getStatus()
Get the call status, for example on a http request this should give the response code |
double |
getValueAsDouble(java.lang.String elementName)
Retrieve the named child, convert it's value to a double and return it. |
int |
getValueAsInt(java.lang.String elementName)
Retrieve the named child, convert it's value to an int and return it. |
java.lang.String |
getValueAsString(java.lang.String elementName)
Gets the value attribute of the specified node as a string. |
int |
hashCode()
The hashcode of the serviceID String |
void |
remove(XModel child)
|
void |
set(java.lang.Object s)
Sets the model value |
void |
set(java.lang.String attribName,
java.lang.Object newObject)
Set the named attribute value of this XModel node. |
void |
setAttribValue(int i,
java.lang.Object value)
Set the value of an argument |
void |
setAttribValue(int i,
java.lang.String attribName,
java.lang.Object value)
Set the value of an argument |
void |
setAttribValue(java.lang.String name,
java.lang.Object value)
Set the value of an argument |
void |
setNumAttributes(int num)
Set the number of arguments initially used in the route |
void |
setupService(java.lang.String methodName,
ServiceProxy routeService,
java.lang.String[] argNames)
Setup the service with the passed name. |
protected void |
sync()
Syncs the model with the service response is the request has been changed or if the node has timed out. |
| Methods inherited from class net.xoetrope.xui.data.XModel |
|---|
addModelListener, clear, fireModelUpdated, get, getNumAttributes, getNumChildren, getParent, getTagName, hasAutoId, hasAutoId, prefixOutputPath, removeChildren, reset, resetAttributes, setId, setNumChildren, setParent, setTagName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean dirty
protected long expires
protected java.lang.String serviceId
protected ServiceProxy callProxy
| Constructor Detail |
|---|
public XServiceModelNode()
| Method Detail |
|---|
public void setupService(java.lang.String methodName,
ServiceProxy routeService,
java.lang.String[] argNames)
methodName - The name of the servicerouteService - the first ServiceProxy in the routeargNames - the argument names expected by the servicepublic ServiceProxy getServiceProxy()
public ServiceProxy getServiceProxy(java.lang.String reqdClass)
public int hashCode()
hashCode in class XModelprotected void sync()
public java.lang.Object get()
get in class XModelpublic java.lang.Object get(ServiceContext context)
context - the ServiceContext containing context arguments
public java.lang.Object append(java.lang.String id)
XModel
append in class XModelid - The immediate path to the XModel required
public XModel get(int i)
XModel
get in class XModeli - The index of the values array
public void append(XModel newObject)
XModel
append in class XModelnewObject - the child nodepublic void set(java.lang.Object s)
XModel
set in class XModels - the new value
public void set(java.lang.String attribName,
java.lang.Object newObject)
XModel
set in class XModelattribName - The path to the XModel in the format 'base/foonewObject - The new value of the XModelpublic java.lang.String getId()
getId in class XModelpublic java.lang.String getAttribName(int i)
getAttribName in class XModeli - The index of the attribute whose name is required
public int getAttribute(java.lang.String argName)
getAttribute in class XModelargName - the argument name
public void setAttribValue(int i,
java.lang.Object value)
setAttribValue in class XModeli - the argument indexvalue - the new argument value
public void setAttribValue(java.lang.String name,
java.lang.Object value)
name - the name of the argument to be setvalue - The value of be applied to the attribute
public void setAttribValue(int i,
java.lang.String attribName,
java.lang.Object value)
setAttribValue in class XModeli - the argument indexattribName - the name of the attributevalue - the new argument valuepublic double getValueAsDouble(java.lang.String elementName)
XModel
getValueAsDouble in class XModelelementName - The name of the child whose value is required
public int getAttribValueAsInt(int i)
XModel
getAttribValueAsInt in class XModeli - The index of the attributeValues array whose value we want
public int getValueAsInt(java.lang.String elementName)
XModel
getValueAsInt in class XModelelementName - The name of the child to be retrieved
public java.lang.String getAttribValueAsString(int i)
XModel
getAttribValueAsString in class XModeli - The index of the attributeValues array whose value we want
public java.lang.String getValueAsString(java.lang.String elementName)
getValueAsString in class XModelelementName -
public java.lang.Object getAttribValue(int idx)
getAttribValue in class XModelidx - the index of the required argument
public double getAttribValueAsDouble(int i)
getAttribValueAsDouble in class XModeli - The index of the attributeValues array whose value we want
public double getAttribValueAsDouble(int i,
char decimalSeparator,
char groupingSeparator)
getAttribValueAsDouble in class XModeli - The index of the attributeValues array whose value we wantdecimalSeparator - the decimal separatorgroupingSeparator - the grouping (thousands) separator
public void remove(XModel child)
public void setNumAttributes(int num)
setNumAttributes in class XModelnum - the number of argumentspublic int getStatus()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||