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


java.lang.Object
   org.apache.commons.betwixt.expression.Context

All known Subclasses:   org.apache.commons.betwixt.io.read.ReadContext,
Context
public class Context (Code)

Context describes the context used to evaluate bean expressions. This is mostly a bean together with a number of context variables. Context variables are named objects. In other words, a context variable associates an object with a string.

Logging during expression evaluation is done through the logging instance held by this class. The object initiating the evaluation should control this logging and so passing a Log instance is enforced by the constructors.

Context is a natural place to include shared evaluation code. One of the problems that you get with object graphs is that they can be cyclic. Xml cannot (directly) include cycles. Therefore betwixt needs to find and deal properly with cycles. The algorithm used is to check the parentage of a new child. If the child is a parent then that operation fails.


author:
   James Strachan



Constructor Summary
public  Context()
    
public  Context(Object bean, Log log)
     Convenience constructor sets evaluted bean and log.
public  Context(Object bean, Log log, BindingConfiguration bindingConfiguration)
     Convenience constructor sets evaluted bean and log.
public  Context(Context context)
     Construct a cloned context.
public  Context(Object bean, Map variables, Log log)
     Convenience constructor sets evaluted bean, context variables and log.
public  Context(Object bean, Map variables, Log log, BindingConfiguration bindingConfiguration)
     Convenience constructor sets evaluted bean, context variables and log.

Method Summary
public  ObjectgetBean()
     Gets the current bean.
public  StringgetClassNameAttribute()
     The name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.
public  IdStoringStrategygetIdMappingStrategy()
     Gets the strategy used to manage storage and retrieval of id's.
public  StringgetInheritedOption(String name)
     Gets the value of the first option with this name.
public  LoggetLog()
     Gets the current log.
public  booleangetMapIDs()
    
public  ObjectStringConvertergetObjectStringConverter()
     Gets object <-> string converter.
public  OptionsgetOptions()
     Gets the current Options.
public  ValueSuppressionStrategygetValueSuppressionStrategy()
     Gets the ValueSuppressionStrategy.
public  ObjectgetVariable(String name)
     Gets the value of a particular context variable.
public  MapgetVariables()
     Gets context variables.
public  ContextnewContext(Object newBean)
     Returns a new child context with the given bean but the same log and variables.
public  voidpopOptions()
    

Pops the current options from the stack.

public  voidpushOptions(Options options)
    

Pushes the given Options onto the stack.

public  voidsetBean(Object bean)
     Set the current bean.
public  voidsetClassNameAttribute(String classNameAttribute)
     Sets the name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.
public  voidsetLog(Log log)
    
public  voidsetValueSuppressionStrategy(ValueSuppressionStrategy valueSuppressionStrategy)
     Sets the ValueSuppressionStrategy.
public  voidsetVariable(String name, Object value)
     Sets the value of a particular context variable.
public  voidsetVariables(Map variables)
     Sets context variables.


Constructor Detail
Context
public Context()(Code)
Construct context with default log



Context
public Context(Object bean, Log log)(Code)
Convenience constructor sets evaluted bean and log.
Parameters:
  bean - evaluate expressions against this bean
Parameters:
  log - log to this logger



Context
public Context(Object bean, Log log, BindingConfiguration bindingConfiguration)(Code)
Convenience constructor sets evaluted bean and log.
Parameters:
  bean - evaluate expressions against this bean
Parameters:
  log - log to this logger
Parameters:
  bindingConfiguration - not null



Context
public Context(Context context)(Code)
Construct a cloned context. The constructed context should share bean, variables, log and binding configuration.
Parameters:
  context - duplicate the attributes of this bean



Context
public Context(Object bean, Map variables, Log log)(Code)
Convenience constructor sets evaluted bean, context variables and log.
Parameters:
  bean - evaluate expressions against this bean
Parameters:
  variables - context variables
Parameters:
  log - log to this logger



Context
public Context(Object bean, Map variables, Log log, BindingConfiguration bindingConfiguration)(Code)
Convenience constructor sets evaluted bean, context variables and log.
Parameters:
  bean - evaluate expressions against this bean
Parameters:
  variables - context variables
Parameters:
  log - log to this logger
Parameters:
  bindingConfiguration - not null




Method Detail
getBean
public Object getBean()(Code)
Gets the current bean. the bean against which expressions are evaluated



getClassNameAttribute
public String getClassNameAttribute()(Code)
The name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.

The default value is 'className'.

The name of the attribute used to overload the class name of a bean
since:
   0.5



getIdMappingStrategy
public IdStoringStrategy getIdMappingStrategy()(Code)
Gets the strategy used to manage storage and retrieval of id's.
since:
   0.7 Returns the idStoringStrategy, not null



getInheritedOption
public String getInheritedOption(String name)(Code)
Gets the value of the first option with this name. The stack of inherited options is search (starting from the current option) until an option with a non-null value for the named option is found.
Parameters:
  name - the name of the option to be found option value or null if this value is never set
since:
   0.8



getLog
public Log getLog()(Code)
Gets the current log. the implementation to which this class logs



getMapIDs
public boolean getMapIDs()(Code)
Should ID's and IDREF attributes be used to cross-reference matching objects? true if ID and IDREF attributes should be used to cross-reference instances
since:
   0.5



getObjectStringConverter
public ObjectStringConverter getObjectStringConverter()(Code)
Gets object <-> string converter. the Converter to be used for conversions, not null
since:
   0.5



getOptions
public Options getOptions()(Code)
Gets the current Options. Options that currently applyor null if there are no current options.
since:
   0.7



getValueSuppressionStrategy
public ValueSuppressionStrategy getValueSuppressionStrategy()(Code)
Gets the ValueSuppressionStrategy. This is used to control the expression of attributes with certain values.
since:
   0.7 ValueSuppressionStrategy, not null



getVariable
public Object getVariable(String name)(Code)
Gets the value of a particular context variable.
Parameters:
  name - the name of the variable whose value is to be returned the variable value or null if the variable isn't set



getVariables
public Map getVariables()(Code)
Gets context variables. map containing variable values keyed by variable name



newContext
public Context newContext(Object newBean)(Code)
Returns a new child context with the given bean but the same log and variables.
Parameters:
  newBean - create a child context for this bean new Context with new bean but shared variables



popOptions
public void popOptions()(Code)

Pops the current options from the stack. The previously current options (if any exist) will be reinstated by this method.

Note code calling this method should have previsouly called Context.popOptions .
since:
   0.7




pushOptions
public void pushOptions(Options options)(Code)

Pushes the given Options onto the stack.

Note that code calling push should ensure that Context.popOptions is called once the options are no longer current. This ensures that the previous options are reinstated.


since:
   0.7
Parameters:
  options - newly current Options, not null



setBean
public void setBean(Object bean)(Code)
Set the current bean.
Parameters:
  bean - the Object against which expressions will be evaluated



setClassNameAttribute
public void setClassNameAttribute(String classNameAttribute)(Code)
Sets the name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.

The default value is 'className'.


Parameters:
  classNameAttribute - The name of the attribute used to overload the class name of a bean
since:
   0.5



setLog
public void setLog(Log log)(Code)
Set the log implementation to which this class logs
Parameters:
  log - the implemetation that this class should log to



setValueSuppressionStrategy
public void setValueSuppressionStrategy(ValueSuppressionStrategy valueSuppressionStrategy)(Code)
Sets the ValueSuppressionStrategy. This is used to control the expression of attributes with certain values.
since:
   0.7
Parameters:
  valueSuppressionStrategy - ValueSuppressionStrategy, not null



setVariable
public void setVariable(String name, Object value)(Code)
Sets the value of a particular context variable.
Parameters:
  name - the name of the variable
Parameters:
  value - the value of the variable



setVariables
public void setVariables(Map variables)(Code)
Sets context variables.
Parameters:
  variables - map containing variable values indexed by varibable name Strings



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.