Java Doc for XModel.java in  » XML-UI » XUI » net » xoetrope » xui » data » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML UI » XUI » net.xoetrope.xui.data 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.xoetrope.xui.data.XModel

All known Subclasses:   net.xoetrope.optional.data.sql.DatabaseRowModel,  net.xoetrope.optional.service.XServiceModelNode,  net.xoetrope.optional.data.sql.DatabaseFieldModel,  net.xoetrope.xui.data.XBaseModel,
XModel
abstract public class XModel (Code)
The XModel is designed to support an MVC like structure. The model allows data to be maintained separately from UI code and separately from the control logic. The model supports an XPath like way of naming nodes and accessing data. The model is hierarchical and therefore a variety of data can be stored including simple scalar values to vectors and arrays. The model can be supplemented by adding custom node types and by using adapters and bindings.

The XModel is one of the main ideas behind XUI and central to providing the clean separation of the data. The XUI UI components can be abstractly bound to the model as instances of XModel although the actual nodes may be implemented by a range of classes representing tables or lists of even more complex nodes. All the UI component need know the path to the node in the model.
In some cases an adapter is used to simplify access to the data and perhaps maintain additional information needed by the UI component (e.g. the selected value in a list).

Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
version:
   $Revision: 1.30 $



Field Summary
protected  StringtagName
    


Method Summary
public  voidaddModelListener(XModelListener listener, String name)
    
abstract public  voidappend(XModel childNode)
    
abstract public  Objectappend(String elementName)
     Append a new node with the specified name.
public  voidclear()
    
public  voidfireModelUpdated()
    
public  Objectget(String element)
    
abstract public  XModelget(int i)
    
abstract public  Objectget()
    
abstract public  StringgetAttribName(int i)
    
abstract public  ObjectgetAttribValue(int i)
    
abstract public  doublegetAttribValueAsDouble(int i)
    
abstract public  intgetAttribValueAsInt(int i)
    
abstract public  StringgetAttribValueAsString(int i)
    
abstract public  intgetAttribute(String attribName)
    
abstract public  StringgetId()
    
public static  XModelgetInstance()
     Get the root instance of the model.
public  intgetNumAttributes()
    
public  intgetNumChildren()
    
public  StringgetTagName()
     Gets the model element tag name, e.g.
abstract public  doublegetValueAsDouble(String elementName)
    
abstract public  intgetValueAsInt(String elementName)
     Gets the value attribute of the specified node as an int.
abstract public  StringgetValueAsString(String elementName)
     Gets the value attribute of the specified node as a string.
public  booleanhasAutoId()
     true if there was no name for the element in the DataSource, anexample of this is the annonymouse nodes used to represent the record ofa table e.g.
public  voidhasAutoId(boolean b)
     Used for elements which need a name assigned temporarily because one doesn't exist in the DataSource.
abstract public  inthashCode()
     Get a hash code for the node.
public static  StringprefixOutputPath(String path)
    
public  voidremoveChildren()
    
public  XModelreset()
    
public  voidresetAttributes()
    
abstract public  voidset(String attribName, Object newObject)
     Set the named attribute value of this XModel node.
abstract public  voidset(Object s)
    
abstract public  voidsetAttribValue(int i, Object value)
    
abstract public  voidsetAttribValue(int i, String attribName, Object value)
    
public  voidsetId(String newId)
    
public  voidsetNumAttributes(int num)
     Setup the attributeNames and attributeValues arrays.
public  voidsetNumChildren(int num)
    
public  voidsetTagName(String name)
     Sets the model element tag name, e.g.

Field Detail
tagName
protected String tagName(Code)





Method Detail
addModelListener
public void addModelListener(XModelListener listener, String name)(Code)
Add a new listener to this model node
Parameters:
  listener - the listener object
Parameters:
  name - the name of the metod to be invoked



append
abstract public void append(XModel childNode)(Code)
Append a node
Parameters:
  childNode - the child node



append
abstract public Object append(String elementName)(Code)
Append a new node with the specified name. This method does not replace any existing nodes.
Parameters:
  element - The immediate path to the XModel required The value of the XModel or the attribute



clear
public void clear()(Code)
Return this node to its initial state by removing its children and attributes



fireModelUpdated
public void fireModelUpdated()(Code)
Notify the listeners that this model node has changed



get
public Object get(String element)(Code)
Get the value of the element located at the path in the element parameter If the attribName parameter is not null we get the value of the attributeValues
Parameters:
  element - The path to the XModel we require The value of the XModel or the attribute



get
abstract public XModel get(int i)(Code)
Get the XModel at element i
Parameters:
  i - The index of the values array The XModel at location i



get
abstract public Object get()(Code)
gets the value attribute the value of the model



getAttribName
abstract public String getAttribName(int i)(Code)

Parameters:
  i - The index of the attributeNames array whose value we want The string value of the attributeNames array at position i



getAttribValue
abstract public Object getAttribValue(int i)(Code)

Parameters:
  i - The index of the attributeValues array whose value we want The string value of the attributeValues array at position i



getAttribValueAsDouble
abstract public double getAttribValueAsDouble(int i)(Code)

Parameters:
  i - The index of the attributeValues array whose value we want The double value of the attributeValues array at position i



getAttribValueAsInt
abstract public int getAttribValueAsInt(int i)(Code)

Parameters:
  i - The index of the attributeValues array whose value we want The int value of the attributeValues array at position i



getAttribValueAsString
abstract public String getAttribValueAsString(int i)(Code)

Parameters:
  i - The index of the attributeValues array whose value we want The string value of the attributeValues array at position i



getAttribute
abstract public int getAttribute(String attribName)(Code)
returns the index of the attribiteNames array whose value is the same as the attribName
Parameters:
  attribName - The name of the attribute we are trying to locate The index of the attributeNames array containg the name



getId
abstract public String getId()(Code)
Gets the value of the ID attribute the ID attribute



getInstance
public static XModel getInstance()(Code)
Get the root instance of the model. This class now delegates to the project manager. the root XModel instance.'deprecated since 1.0.3



getNumAttributes
public int getNumAttributes()(Code)
Gets the number of attributes of this node the number of attributes



getNumChildren
public int getNumChildren()(Code)
Gets the number of immediate children of this node the number of child nodes



getTagName
public String getTagName()(Code)
Gets the model element tag name, e.g. 'Component' from the XML fragment



getValueAsDouble
abstract public double getValueAsDouble(String elementName)(Code)
Gets the value attribute as a Double value
Parameters:
  elementName - the value as a double



getValueAsInt
abstract public int getValueAsInt(String elementName)(Code)
Gets the value attribute of the specified node as an int.
Parameters:
  elementName - the value as an int



getValueAsString
abstract public String getValueAsString(String elementName)(Code)
Gets the value attribute of the specified node as a string.
Parameters:
  elementName - the value as a string



hasAutoId
public boolean hasAutoId()(Code)
true if there was no name for the element in the DataSource, anexample of this is the annonymouse nodes used to represent the record ofa table e.g.
......



hasAutoId
public void hasAutoId(boolean b)(Code)
Used for elements which need a name assigned temporarily because one doesn't exist in the DataSource.
Parameters:
  b - true if there was no name in the DataSource



hashCode
abstract public int hashCode()(Code)
Get a hash code for the node. the node's hash code



prefixOutputPath
public static String prefixOutputPath(String path)(Code)
Prefix the output path if the prefix is not already present
Parameters:
  path -



removeChildren
public void removeChildren()(Code)
Remove the children of this node



reset
public XModel reset()(Code)
Reset the whole model, giving a new root node and a new hierarchy 'deprecated since 1.0.3



resetAttributes
public void resetAttributes()(Code)
Reset the attributes of this node



set
abstract public void set(String attribName, Object newObject)(Code)
Set the named attribute value of this XModel node. If the attribName is null then this node's value is updated.
Parameters:
  elementName - The path to the XModel in the format 'base/foo
Parameters:
  newObject - The new value of the XModel



set
abstract public void set(Object s)(Code)
Sets the model value
Parameters:
  s - the new value



setAttribValue
abstract public void setAttribValue(int i, Object value)(Code)
Sets the attribute value
Parameters:
  i - The index of the attributeValues array whose value we want
Parameters:
  value - the value object



setAttribValue
abstract public void setAttribValue(int i, String attribName, Object value)(Code)
Sets the attribute name and value
Parameters:
  i - The index of the attributeValues array whose value we want
Parameters:
  attribName - the name of the attribute
Parameters:
  value - the value object



setId
public void setId(String newId)(Code)
Sets the ID attribute
Parameters:
  newId - the new name



setNumAttributes
public void setNumAttributes(int num)(Code)
Setup the attributeNames and attributeValues arrays. If not already initialised set the size of each to 2 otherwise store them temporarily and reassign to the increased size arrays.
Parameters:
  num - The new size of the array



setNumChildren
public void setNumChildren(int num)(Code)
Set the number of children of this node
Parameters:
  num - the new number of children



setTagName
public void setTagName(String name)(Code)
Sets the model element tag name, e.g. 'Component' from the XML fragment Parameters:
  name -



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.