Java Doc for ItsNatVariableResolver.java in  » Ajax » ItsNat » org » itsnat » core » 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 » Ajax » ItsNat » org.itsnat.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.itsnat.core.ItsNatVariableResolver

All known Subclasses:   org.itsnat.impl.core.ItsNatVariableResolverImpl,
ItsNatVariableResolver
public interface ItsNatVariableResolver (Code)
Used to locate/replace text marks (variables) inside text based nodes (text nodes, comments, attribute values etc) without knowing the exact position in the DOM tree.

The variable syntax follows the JSP Expression Language notation: ${name}.


author:
   Jose Maria Arranz Santamaria
See Also:   ItsNatServletRequest.createItsNatVariableResolver
See Also:   ItsNatDocument.createItsNatVariableResolver
See Also:   ItsNatSession.createItsNatVariableResolver
See Also:   ItsNatServletContext.createItsNatVariableResolver




Method Summary
public  ItsNatVariableResolvercreateItsNatVariableResolver()
     Creates a variable resolver as a child of this resolver (bound to this resolver).
public  ObjectgetLocalVariable(String name)
     Returns the value associated to the specified name, only the local registry of this resolver is searched.
Parameters:
  name - the name to search for.
public  ObjectgetVariable(String name)
     Returns the value associated to the specified name.

First of all the local registry is searched calling ItsNatVariableResolver.getLocalVariable(String) if returns null then the "owner" of this resolver is used:

If the variable resolver is a child of another variable resolver (was created with ItsNatVariableResolver.createItsNatVariableResolver() ) then the method ItsNatVariableResolver.getVariable(String) of the parent is called to continue searching.

If the variable resolver was created with org.itsnat.core.ItsNatServletContext.createItsNatVariableResolver then the method ServletContext.getAttribute(String) is called to continue searching.

If the variable resolver was created with org.itsnat.core.ItsNatSession.createItsNatVariableResolver then the method org.itsnat.core.ItsNatSession.getAttribute(String) is called to continue searching, if returns null then delegates to the method ServletContext.getAttribute(String).

If the variable resolver was created with org.itsnat.core.ItsNatDocument.createItsNatVariableResolver then the method org.itsnat.core.ItsNatDocument.getAttribute(String) is called to continue searching, if returns null then delegates to the method org.itsnat.core.ItsNatSession.getAttribute(String) , if returns null then delegates to the method ServletContext.getAttribute(String).


Parameters:
  name - the name to search for.
public  voidintrospect(String refName, Object obj)
     Introspect the specified object registering all JavaBeans properties as local variables prefixed with the specified reference name.

Current implementation uses jav.beans.Introspector.getBeanInfo(Class) to get all JavaBeans properties.

public  ObjectremoveLocalVariable(String name)
     Unregisters the variable with the specified name from the local registry of this resolver.
Parameters:
  name - the variable name.
public  Stringresolve(String str)
     Locates and replaces any variable declaration with format ${name} contained into the specified string with the variable value converted to string (Object.toString()).
public  booleanresolve(Node node)
     Iterates recursively into the DOM subtree resolving (replacing) if possible any variable found with the format ${name} into element attributes and text based nodes.

The method ItsNatVariableResolver.resolve(String) is used to process element attributes and content of text based nodes.
Parameters:
  node - the node to resolve.

public  ObjectsetLocalVariable(String name, Object value)
     Registers the specified variable name and value into the local registry of this resolver.
Parameters:
  name - the variable name.
Parameters:
  value - the variable value.



Method Detail
createItsNatVariableResolver
public ItsNatVariableResolver createItsNatVariableResolver()(Code)
Creates a variable resolver as a child of this resolver (bound to this resolver). a variable resolver bound to this resolver.



getLocalVariable
public Object getLocalVariable(String name)(Code)
Returns the value associated to the specified name, only the local registry of this resolver is searched.
Parameters:
  name - the name to search for. the value associated to the specified name or null if none is found.
See Also:   ItsNatVariableResolver.setLocalVariable(String,Object)
See Also:   ItsNatVariableResolver.removeLocalVariable(String)
See Also:   



getVariable
public Object getVariable(String name)(Code)
Returns the value associated to the specified name.

First of all the local registry is searched calling ItsNatVariableResolver.getLocalVariable(String) if returns null then the "owner" of this resolver is used:

If the variable resolver is a child of another variable resolver (was created with ItsNatVariableResolver.createItsNatVariableResolver() ) then the method ItsNatVariableResolver.getVariable(String) of the parent is called to continue searching.

If the variable resolver was created with org.itsnat.core.ItsNatServletContext.createItsNatVariableResolver then the method ServletContext.getAttribute(String) is called to continue searching.

If the variable resolver was created with org.itsnat.core.ItsNatSession.createItsNatVariableResolver then the method org.itsnat.core.ItsNatSession.getAttribute(String) is called to continue searching, if returns null then delegates to the method ServletContext.getAttribute(String).

If the variable resolver was created with org.itsnat.core.ItsNatDocument.createItsNatVariableResolver then the method org.itsnat.core.ItsNatDocument.getAttribute(String) is called to continue searching, if returns null then delegates to the method org.itsnat.core.ItsNatSession.getAttribute(String) , if returns null then delegates to the method ServletContext.getAttribute(String).


Parameters:
  name - the name to search for. the value associated to the specified name or null if none is found.



introspect
public void introspect(String refName, Object obj)(Code)
Introspect the specified object registering all JavaBeans properties as local variables prefixed with the specified reference name.

Current implementation uses jav.beans.Introspector.getBeanInfo(Class) to get all JavaBeans properties. The reference name and property name are used to build a qualified name using a dot as separator, this qualified name is used to register as variable (e.g. "person.firstName" where "person" is the reference name and "firstName" is a JavaBeans property).


Parameters:
  refName - reference name used to qualify JavaBeans properties. If null or empty no prefix is added to property names.
Parameters:
  obj - reference to the object value to introspect and register its JavaBeans properties.



removeLocalVariable
public Object removeLocalVariable(String name)(Code)
Unregisters the variable with the specified name from the local registry of this resolver.
Parameters:
  name - the variable name. the variable value or null if not found.
See Also:   ItsNatVariableResolver.getLocalVariable(String)
See Also:   



resolve
public String resolve(String str)(Code)
Locates and replaces any variable declaration with format ${name} contained into the specified string with the variable value converted to string (Object.toString()).

To obtain the value the method ItsNatVariableResolver.getVariable(String) is called, if no variable is found the variable declaration is kept as is.

The same variable may be repeated.


Parameters:
  str - the source string to resolve declared variables. the new string with replaced variables by values. If no variable was replaced (the original string is untouched) returns null.
See Also:   ItsNatVariableResolver.resolve(org.w3c.dom.Node)



resolve
public boolean resolve(Node node)(Code)
Iterates recursively into the DOM subtree resolving (replacing) if possible any variable found with the format ${name} into element attributes and text based nodes.

The method ItsNatVariableResolver.resolve(String) is used to process element attributes and content of text based nodes.
Parameters:
  node - the node to resolve. true if some variable was resolved (replaced).




setLocalVariable
public Object setLocalVariable(String name, Object value)(Code)
Registers the specified variable name and value into the local registry of this resolver.
Parameters:
  name - the variable name.
Parameters:
  value - the variable value. the old value or null if not found.
See Also:   ItsNatVariableResolver.getLocalVariable(String)
See Also:   



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