Java Doc for Component.java in  » Web-Framework » struts-2.0.11 » org » apache » struts2 » components » 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 » Web Framework » struts 2.0.11 » org.apache.struts2.components 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.struts2.components.Component

All known Subclasses:   org.apache.struts2.components.ElseIf,  org.apache.struts2.components.ActionComponent,  org.apache.struts2.components.AppendIterator,  org.apache.struts2.components.Param,  org.apache.struts2.components.Property,  org.apache.struts2.components.Set,  org.apache.struts2.components.Push,  org.apache.struts2.components.Bean,  org.apache.struts2.components.Text,  org.apache.struts2.components.Date,  org.apache.struts2.components.OptGroup,  org.apache.struts2.components.I18n,  org.apache.struts2.components.URL,  org.apache.struts2.components.Else,  org.apache.struts2.components.IteratorComponent,  org.apache.struts2.components.MergeIterator,  org.apache.struts2.components.UIBean,  org.apache.struts2.components.If,  org.apache.struts2.components.Include,
Component
public class Component (Code)
Base class to extend for UI components.

This class is a good extension point when building reuseable UI components.



Field Summary
final public static  StringCOMPONENT_STACK
    
protected  ActionMapperactionMapper
    
protected  Stringid
    
protected  Mapparameters
    
protected  ValueStackstack
    

Constructor Summary
public  Component(ValueStack stack)
     Constructor.

Method Summary
public  voidaddAllParameters(Map params)
     Adds all the given parameters to this component's own parameters.
public  voidaddParameter(String key, Object value)
     Adds the given key and value to this component's own parameter.
public  booleanaltSyntax()
     Is the altSyntax enabled? [TRUE]

See struts.properties where the altSyntax flag is defined.

public  voidcopyParams(Map params)
     Pushes this component's parameter Map as well as the component itself on to the stack and then copies the supplied parameters over.
protected  StringdetermineActionURL(String action, String namespace, String method, HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme, boolean includeContext, boolean encodeResult)
     Renders an action URL by consulting the org.apache.struts2.dispatcher.mapper.ActionMapper .
protected  StringdetermineActionURL(String action, String namespace, String method, HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort, boolean escapeAmp)
     Renders an action URL by consulting the org.apache.struts2.dispatcher.mapper.ActionMapper .
protected  StringdetermineNamespace(String namespace, ValueStack stack, HttpServletRequest req)
     Determines the namespace of the current page being renderdd.
public  booleanend(Writer writer, String body)
     Callback for the end tag of this component. Should the body be evaluated again?

NOTE: will pop component stack.
Parameters:
  writer - the output writer.
Parameters:
  body - the rendered body.

protected  booleanend(Writer writer, String body, boolean popComponentStack)
     Callback for the start tag of this component.
protected  StrutsExceptionfieldError(String field, String errorMsg, Exception e)
     Constructs a RuntimeException based on the given information.

A message is constructed and logged at ERROR level before being returned as a RuntimeException.
Parameters:
  field - field name used when throwing RuntimeException.
Parameters:
  errorMsg - error message used when throwing RuntimeException.
Parameters:
  e - the caused exception, can be null.

protected  ComponentfindAncestor(Class clazz)
     Finds the nearest ancestor of this component stack.
Parameters:
  clazz - the class to look for, or if assignable from.
protected  StringfindString(String expr)
     Evaluates the OGNL stack to find a String value.
Parameters:
  expr - OGNL expression.
protected  StringfindString(String expr, String field, String errorMsg)
     Evaluates the OGNL stack to find a String value.

If the given expression is null a error is logged and a RuntimeException is thrown constructed with a messaged based on the given field and errorMsg paramter.
Parameters:
  expr - OGNL expression.
Parameters:
  field - field name used when throwing RuntimeException.
Parameters:
  errorMsg - error message used when throwing RuntimeException.

protected  ObjectfindValue(String expr)
     Finds a value from the OGNL stack based on the given expression. Will always evaluate expr against stack except when expr is null.
protected  ObjectfindValue(String expr, String field, String errorMsg)
     Evaluates the OGNL stack to find an Object value.

Function just like findValue(String) except that if the given expression is null a error is logged and a RuntimeException is thrown constructed with a messaged based on the given field and errorMsg paramter.
Parameters:
  expr - OGNL expression.
Parameters:
  field - field name used when throwing RuntimeException.
Parameters:
  errorMsg - error message used when throwing RuntimeException.

protected  ObjectfindValue(String expr, Class toType)
     Evaluates the OGNL stack to find an Object of the given type.
public  StackgetComponentStack()
     Gets the component stack of this component.
public  StringgetId()
     Gets the id for referencing element.
public  MapgetParameters()
     Gets the parameters. the parameters.
public  ValueStackgetStack()
     Gets the OGNL value stack assoicated with this component.
protected  voidpopComponentStack()
     Pops the component stack.
public  voidsetActionMapper(ActionMapper mapper)
    
public  voidsetId(String id)
    
public  booleanstart(Writer writer)
     Callback for the start tag of this component. Should the body be evaluated?
Parameters:
  writer - the output writer.
protected  StringtoString(Throwable t)
     Constructs a string representation of the given exception.
public  booleanusesBody()
     Overwrite to set if body shold be used.

Field Detail
COMPONENT_STACK
final public static String COMPONENT_STACK(Code)



actionMapper
protected ActionMapper actionMapper(Code)



id
protected String id(Code)



parameters
protected Map parameters(Code)



stack
protected ValueStack stack(Code)




Constructor Detail
Component
public Component(ValueStack stack)(Code)
Constructor.
Parameters:
  stack - OGNL value stack.




Method Detail
addAllParameters
public void addAllParameters(Map params)(Code)
Adds all the given parameters to this component's own parameters.
Parameters:
  params - the parameters to add.



addParameter
public void addParameter(String key, Object value)(Code)
Adds the given key and value to this component's own parameter.

If the provided key is null nothing happens. If the provided value is null any existing parameter with the given key name is removed.
Parameters:
  key - the key of the new parameter to add.
Parameters:
  value - the value assoicated with the key.




altSyntax
public boolean altSyntax()(Code)
Is the altSyntax enabled? [TRUE]

See struts.properties where the altSyntax flag is defined.




copyParams
public void copyParams(Map params)(Code)
Pushes this component's parameter Map as well as the component itself on to the stack and then copies the supplied parameters over. Because the component's parameter Map is pushed before the component itself, any key-value pair that can't be assigned to componet will be set in the parameters Map.
Parameters:
  params - the parameters to copy.



determineActionURL
protected String determineActionURL(String action, String namespace, String method, HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme, boolean includeContext, boolean encodeResult)(Code)
Renders an action URL by consulting the org.apache.struts2.dispatcher.mapper.ActionMapper .
Parameters:
  action - the action
Parameters:
  namespace - the namespace
Parameters:
  method - the method
Parameters:
  req - HTTP request
Parameters:
  res - HTTP response
Parameters:
  parameters - parameters
Parameters:
  scheme - http or https
Parameters:
  includeContext - should the context path be included or not
Parameters:
  encodeResult - should the url be encoded the action url.



determineActionURL
protected String determineActionURL(String action, String namespace, String method, HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort, boolean escapeAmp)(Code)
Renders an action URL by consulting the org.apache.struts2.dispatcher.mapper.ActionMapper .
Parameters:
  action - the action
Parameters:
  namespace - the namespace
Parameters:
  method - the method
Parameters:
  req - HTTP request
Parameters:
  res - HTTP response
Parameters:
  parameters - parameters
Parameters:
  scheme - http or https
Parameters:
  includeContext - should the context path be included or not
Parameters:
  encodeResult - should the url be encoded
Parameters:
  forceAddSchemeHostAndPort - should the scheme host and port be added to the url no matter what
Parameters:
  escapeAmp - should the ampersands used separate parameters be escaped or not the action url.



determineNamespace
protected String determineNamespace(String namespace, ValueStack stack, HttpServletRequest req)(Code)
Determines the namespace of the current page being renderdd. Useful for Form, URL, and href generations.
Parameters:
  namespace - the namespace
Parameters:
  stack - OGNL value stack
Parameters:
  req - HTTP request the namepsace of the current page being rendered, is never null.



end
public boolean end(Writer writer, String body)(Code)
Callback for the end tag of this component. Should the body be evaluated again?

NOTE: will pop component stack.
Parameters:
  writer - the output writer.
Parameters:
  body - the rendered body. true if the body should be evaluated again




end
protected boolean end(Writer writer, String body, boolean popComponentStack)(Code)
Callback for the start tag of this component. Should the body be evaluated again?

NOTE: has a parameter to determine to pop the component stack.
Parameters:
  writer - the output writer.
Parameters:
  body - the rendered body.
Parameters:
  popComponentStack - should the component stack be popped? true if the body should be evaluated again




fieldError
protected StrutsException fieldError(String field, String errorMsg, Exception e)(Code)
Constructs a RuntimeException based on the given information.

A message is constructed and logged at ERROR level before being returned as a RuntimeException.
Parameters:
  field - field name used when throwing RuntimeException.
Parameters:
  errorMsg - error message used when throwing RuntimeException.
Parameters:
  e - the caused exception, can be null. the constructed StrutsException.




findAncestor
protected Component findAncestor(Class clazz)(Code)
Finds the nearest ancestor of this component stack.
Parameters:
  clazz - the class to look for, or if assignable from. the component if found, null if not.



findString
protected String findString(String expr)(Code)
Evaluates the OGNL stack to find a String value.
Parameters:
  expr - OGNL expression. the String value found.



findString
protected String findString(String expr, String field, String errorMsg)(Code)
Evaluates the OGNL stack to find a String value.

If the given expression is null a error is logged and a RuntimeException is thrown constructed with a messaged based on the given field and errorMsg paramter.
Parameters:
  expr - OGNL expression.
Parameters:
  field - field name used when throwing RuntimeException.
Parameters:
  errorMsg - error message used when throwing RuntimeException. the String value found.
throws:
  StrutsException - is thrown in case of expression is null.




findValue
protected Object findValue(String expr)(Code)
Finds a value from the OGNL stack based on the given expression. Will always evaluate expr against stack except when expr is null. If altsyntax (%{...}) is applied, simply strip it off.
Parameters:
  expr - the expression. Returns null if expr is null. the value, null if not found.



findValue
protected Object findValue(String expr, String field, String errorMsg)(Code)
Evaluates the OGNL stack to find an Object value.

Function just like findValue(String) except that if the given expression is null a error is logged and a RuntimeException is thrown constructed with a messaged based on the given field and errorMsg paramter.
Parameters:
  expr - OGNL expression.
Parameters:
  field - field name used when throwing RuntimeException.
Parameters:
  errorMsg - error message used when throwing RuntimeException. the Object found, is never null.
throws:
  StrutsException - is thrown in case of not found in the OGNL stack, or expression is null.




findValue
protected Object findValue(String expr, Class toType)(Code)
Evaluates the OGNL stack to find an Object of the given type. Will evaluate expr the portion wrapped with altSyntax (%{...}) against stack when altSyntax is on, else the whole expr is evaluated against the stack.

This method only supports the altSyntax. So this should be set to true.
Parameters:
  expr - OGNL expression.
Parameters:
  toType - the type expected to find. the Object found, or null if not found.




getComponentStack
public Stack getComponentStack()(Code)
Gets the component stack of this component. the component stack of this component, never null.



getId
public String getId()(Code)
Gets the id for referencing element. the id for referencing element.



getParameters
public Map getParameters()(Code)
Gets the parameters. the parameters. Is never null.



getStack
public ValueStack getStack()(Code)
Gets the OGNL value stack assoicated with this component. the OGNL value stack assoicated with this component.



popComponentStack
protected void popComponentStack()(Code)
Pops the component stack.



setActionMapper
public void setActionMapper(ActionMapper mapper)(Code)



setId
public void setId(String id)(Code)



start
public boolean start(Writer writer)(Code)
Callback for the start tag of this component. Should the body be evaluated?
Parameters:
  writer - the output writer. true if the body should be evaluated



toString
protected String toString(Throwable t)(Code)
Constructs a string representation of the given exception.
Parameters:
  t - the exception the exception as a string.



usesBody
public boolean usesBody()(Code)
Overwrite to set if body shold be used. always false for this component.



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.