Java Doc for XBaseModel.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
      net.xoetrope.xui.data.XBaseModel

All known Subclasses:   net.xoetrope.optional.data.sql.DatabaseTableModel,
XBaseModel
public class XBaseModel extends XModel implements Cloneable(Code)
The basic implementation of the XModel is handled by this class. Static data is loaded from an XML file pointed to by the startup.properties file by default using an XDataSource. The model is central to XUI and allows the UI components to be separated from the data in an abstract fashion. This model element is designed to support static data, text, list and tabular structures.

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



Field Summary
final public static  intID_ATTRIBUTE
    
final public static  intNUM_FIXED_ATTRIBUTE
    
final public static  intVALUE_ATTRIBUTE
    
protected  booleanaddByDefault
    
protected static  booleanappendByDefault
    
protected  XModelparentModel
    
protected  XModel[]values
    

Constructor Summary
public  XBaseModel(XModel parent)
     Constructs an instance of the model node.
public  XBaseModel()
    

Method Summary
public  Objectappend(String elementName)
     Append a new node with the specified name.
public  voidappend(XModel childNode)
     Appends a node to the model.
public  Objectget(String element)
     Get the value of the element located at the path in the element parameter.
public  XModelget(int i)
    
public  Objectget()
    
public  booleangetAddByDefault()
    
public static  booleangetAppendByDefault()
    
protected  StringgetAttribFromPath(String path)
     Get the attribute from a path e.g.
public  StringgetAttribName(int i)
    
public  ObjectgetAttribValue(int i)
    
public  doublegetAttribValueAsDouble(int i)
    
public  intgetAttribValueAsInt(int index)
    
public  StringgetAttribValueAsString(int i)
    
public  intgetAttribute(String attribName)
    
protected  StringgetBaseFromPath(String path)
     Get the base path from a path e.g.
public  booleangetChildExists(String name)
     Check to see if the specified child node exists.
public  StringgetId()
    
public  intgetNumAttributes()
    
public  intgetNumChildren()
    
public  XModelgetParent()
    
public  doublegetValueAsDouble(String elementName)
    
public  intgetValueAsInt(String elementName)
     Gets the value attribute of the specified node as an int.
public  StringgetValueAsString(String elementName)
     Gets the value attribute of the specified node as a string.
public  voidhasAutoId(boolean b)
     Used for elements which need a name assigned temporarily because one doesn't exist in the DataSource.
public  booleanhasAutoId()
    
public  inthashCode()
    
public  voidinsertChildAt(XModel newNode, int idx)
    
public  voidremove(XModel child)
     Remove a child node from this XModel instance.
public  voidremoveAttributes()
    
public  voidremoveChild(String name)
    
public  voidremoveChild(String name, String value)
    
public  voidremoveChildren()
    
public  voidset(String elementName, Object newObject)
     Set the value of the element in the child XModel located at the elementName. The child node matching the element is first retrieved and then the named attribute is updated.
public  voidset(Object s)
     Sets the model value of this node.
public  voidsetAddByDefault(boolean state)
    
public static  voidsetAppendByDefault(boolean state)
    
public  voidsetAttribValue(int index, Object value)
    
public  voidsetAttribValue(int index, String attribName, Object value)
    
public  voidsetId(String newName)
    
public  voidsetNumAttributes(int num)
     Setup the attributeNames and attributeValues arrays.
public  voidsetNumChildren(int num)
    

Field Detail
ID_ATTRIBUTE
final public static int ID_ATTRIBUTE(Code)



NUM_FIXED_ATTRIBUTE
final public static int NUM_FIXED_ATTRIBUTE(Code)



VALUE_ATTRIBUTE
final public static int VALUE_ATTRIBUTE(Code)



addByDefault
protected boolean addByDefault(Code)



appendByDefault
protected static boolean appendByDefault(Code)



parentModel
protected XModel parentModel(Code)



values
protected XModel[] values(Code)




Constructor Detail
XBaseModel
public XBaseModel(XModel parent)(Code)
Constructs an instance of the model node.



XBaseModel
public XBaseModel()(Code)




Method Detail
append
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



append
public void append(XModel childNode)(Code)
Appends a node to the model. If a node of the same name is found it is replaced. If there is insufficient space to store the new node then the storage is automatically expanded.
The child nodes should be named uniquely or not at all (i.e. they should be annonymous). If the new childNode has a name then it is compared to the existing nodes and will replace a node of the same name if one exists.
Parameters:
  childNode - the child node



get
public Object get(String element)(Code)
Get the value of the element located at the path in the element parameter. The element name parameter can include an attribute name by appending '@attributeName' to the path, where attributeName is the name of the attribute.
Parameters:
  element - The path to the XModel required The value of the XModel or the attribute



get
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
public Object get()(Code)
gets the value attribute the value of the model



getAddByDefault
public boolean getAddByDefault()(Code)
Get the flags that determines if attributes are added when queried true if an attribute is added if it is missing when queried, or false to return -1when querying a node attribute with "getAttribute( name )".



getAppendByDefault
public static boolean getAppendByDefault()(Code)
Get the flags that determines if attributes are added when queried true if an attribute is added if it is missing when queried, or false to return -1when querying a node attribute with "getAttribute( name )".



getAttribFromPath
protected String getAttribFromPath(String path)(Code)
Get the attribute from a path e.g.
returns 'attrib' from 'a/b/c/@attrib' returns null from 'a/b/c/'
Parameters:
  path - the path to split the attribute name



getAttribName
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
public Object getAttribValue(int i)(Code)

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



getAttribValueAsDouble
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
public int getAttribValueAsInt(int index)(Code)

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



getAttribValueAsString
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
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



getBaseFromPath
protected String getBaseFromPath(String path)(Code)
Get the base path from a path e.g.
returns 'a/b/c/' from 'a/b/c/@attrib' returns 'a/b/c/' from 'a/b/c/' returns null from 'a/b/c/@attrib'
Parameters:
  path - the path to split the path stripped of attributes



getChildExists
public boolean getChildExists(String name)(Code)
Check to see if the specified child node exists. Doing a get() creates the named node by design, so it will always result in a value
Parameters:
  name - the name of the child we are looking for boolean indicating the existance of the child.



getId
public String getId()(Code)
Gets the name attribute the name attribute



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



getParent
public XModel getParent()(Code)



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



getValueAsInt
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
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 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



hasAutoId
public boolean hasAutoId()(Code)
true if there was no name for the element in the DataSource



hashCode
public int hashCode()(Code)



insertChildAt
public void insertChildAt(XModel newNode, int idx)(Code)
Insert a node at a specified index in the list of children
Parameters:
  newNode - the new model node
Parameters:
  idx - the index at which to insert



remove
public void remove(XModel child)(Code)
Remove a child node from this XModel instance. Squeeze the following children so that they are contiguous.
Parameters:
  child - the child to be removed.



removeAttributes
public void removeAttributes()(Code)
Remove the nodes attributes and attribute names



removeChild
public void removeChild(String name)(Code)
Remove a child node
Parameters:
  name - the ID or name of the node



removeChild
public void removeChild(String name, String value)(Code)
Remove a child node
Parameters:
  name - the ID or name of the node
Parameters:
  value - the value of the matching node to remove



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



set
public void set(String elementName, Object newObject)(Code)
Set the value of the element in the child XModel located at the elementName. The child node matching the element is first retrieved and then the named attribute is updated. The attributeName can be specified by appending '@attributeName' to the path, where attributeName is the name of the attribute (e.g. '/fonts/arial/@bold' where 'bold' is the attributeName. If the attributeName is not specified the retreived node's value is updated.
To update this node's value use set( newObject )
Parameters:
  elementName - The path to the XModel in the format 'base/foo
Parameters:
  newObject - The new value of the attribute



set
public void set(Object s)(Code)
Sets the model value of this node.
Parameters:
  s - the new value



setAddByDefault
public void setAddByDefault(boolean state)(Code)
Set the flags that determines if attributes are added when queried
Parameters:
  state - true to add an attribute if it is missing, false to return -1when querying a node attribute with "getAttribute( name )".



setAppendByDefault
public static void setAppendByDefault(boolean state)(Code)
Set the flags that determines if attributes are added when queried
Parameters:
  state - true to add an attribute if it is missing, false to return -1when querying a node attribute with "getAttribute( name )".



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



setAttribValue
public void setAttribValue(int index, String attribName, Object value)(Code)
Sets the attribute value
Parameters:
  index - 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 newName)(Code)
Sets the name attribute
Parameters:
  newName - 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



Fields inherited from net.xoetrope.xui.data.XModel
protected String tagName(Code)(Java Doc)

Methods inherited from net.xoetrope.xui.data.XModel
public void addModelListener(XModelListener listener, String name)(Code)(Java Doc)
abstract public void append(XModel childNode)(Code)(Java Doc)
abstract public Object append(String elementName)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public void fireModelUpdated()(Code)(Java Doc)
public Object get(String element)(Code)(Java Doc)
abstract public XModel get(int i)(Code)(Java Doc)
abstract public Object get()(Code)(Java Doc)
abstract public String getAttribName(int i)(Code)(Java Doc)
abstract public Object getAttribValue(int i)(Code)(Java Doc)
abstract public double getAttribValueAsDouble(int i)(Code)(Java Doc)
abstract public int getAttribValueAsInt(int i)(Code)(Java Doc)
abstract public String getAttribValueAsString(int i)(Code)(Java Doc)
abstract public int getAttribute(String attribName)(Code)(Java Doc)
abstract public String getId()(Code)(Java Doc)
public static XModel getInstance()(Code)(Java Doc)
public int getNumAttributes()(Code)(Java Doc)
public int getNumChildren()(Code)(Java Doc)
public String getTagName()(Code)(Java Doc)
abstract public double getValueAsDouble(String elementName)(Code)(Java Doc)
abstract public int getValueAsInt(String elementName)(Code)(Java Doc)
abstract public String getValueAsString(String elementName)(Code)(Java Doc)
public boolean hasAutoId()(Code)(Java Doc)
public void hasAutoId(boolean b)(Code)(Java Doc)
abstract public int hashCode()(Code)(Java Doc)
public static String prefixOutputPath(String path)(Code)(Java Doc)
public void removeChildren()(Code)(Java Doc)
public XModel reset()(Code)(Java Doc)
public void resetAttributes()(Code)(Java Doc)
abstract public void set(String attribName, Object newObject)(Code)(Java Doc)
abstract public void set(Object s)(Code)(Java Doc)
abstract public void setAttribValue(int i, Object value)(Code)(Java Doc)
abstract public void setAttribValue(int i, String attribName, Object value)(Code)(Java Doc)
public void setId(String newId)(Code)(Java Doc)
public void setNumAttributes(int num)(Code)(Java Doc)
public void setNumChildren(int num)(Code)(Java Doc)
public void setTagName(String name)(Code)(Java Doc)

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.