Java Doc for Resolver.java in  » Library » Apache-commons-beanutils-1.8.0-BETA-src » org » apache » commons » beanutils » expression » 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 » Library » Apache commons beanutils 1.8.0 BETA src » org.apache.commons.beanutils.expression 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.beanutils.expression.Resolver

All known Subclasses:   org.apache.commons.beanutils.expression.DefaultResolver,
Resolver
public interface Resolver (Code)
Property Name Expression Resolver.

Methods such as PropertyUtilsBean's setNestedProperty() method use a Resolver to process a property name expression and resolve nested, indexed and mapped property names. The following code provides an example usage demonstrating all the methods:

 // Iterate through a nested property expression
 while (resolver.hasNested(name)) {
 // isolate a single property from a nested expresion
 String next = resolver.next(name);
 // Process...
 String property = resolver.getProperty(next);
 if (resolver.isIndexed(next)) {
 int index = resolver.getIndex(next);
 bean = getIndexedProperty(bean, property, index);
 } else if (resolver.isMapped(next)) {
 String key = resolver.getKey(next);
 bean = getMappedProperty(bean, property, key);
 } else {
 bean = getSimpleProperty(bean, property);
 }
 // remove the processed property from the expression
 name = resolver.remove(name);
 }
 
In order to create an implementation, it is important to understand how BeanUtils/PropertyUtils uses the resolver. The following are the main methods that use it:
version:
   $Revision: 555845 $ $Date: 2007-07-13 03:52:05 +0100 (Fri, 13 Jul 2007) $
See Also:   org.apache.commons.beanutils.PropertyUtilsBean.setResolver(Resolver)
since:
   1.8.0




Method Summary
 intgetIndex(String expression)
     Extract the index value from the property expression or -1.
 StringgetKey(String expression)
     Extract the map key from the property expression or null.
 StringgetProperty(String expression)
     Return the property name from the property expression.
 booleanhasNested(String expression)
     Indicates whether or not the expression contains nested property expressions or not.
 booleanisIndexed(String expression)
     Indicate whether the expression is for an indexed property or not.
 booleanisMapped(String expression)
     Indicate whether the expression is for a mapped property or not.
 Stringnext(String expression)
     Extract the next property expression from the current expression.
 Stringremove(String expression)
     Remove the last property expresson from the current expression.



Method Detail
getIndex
int getIndex(String expression)(Code)
Extract the index value from the property expression or -1.
Parameters:
  expression - The property expression The index value or -1 if the property is not indexed
throws:
  IllegalArgumentException - If the indexed property is illegallyformed or has an invalid (non-numeric) value



getKey
String getKey(String expression)(Code)
Extract the map key from the property expression or null.
Parameters:
  expression - The property expression The index value
throws:
  IllegalArgumentException - If the mapped property is illegally formed



getProperty
String getProperty(String expression)(Code)
Return the property name from the property expression.
Parameters:
  expression - The property expression The property name



hasNested
boolean hasNested(String expression)(Code)
Indicates whether or not the expression contains nested property expressions or not.
Parameters:
  expression - The property expression The next property expression



isIndexed
boolean isIndexed(String expression)(Code)
Indicate whether the expression is for an indexed property or not.
Parameters:
  expression - The property expression true if the expresion is indexed,otherwise false



isMapped
boolean isMapped(String expression)(Code)
Indicate whether the expression is for a mapped property or not.
Parameters:
  expression - The property expression true if the expresion is mapped,otherwise false



next
String next(String expression)(Code)
Extract the next property expression from the current expression.
Parameters:
  expression - The property expression The next property expression



remove
String remove(String expression)(Code)
Remove the last property expresson from the current expression.
Parameters:
  expression - The property expression The new expression value, with first propertyexpression removed - null if there are no more expressions



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