Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0"?>
<!-- 
   Copyright 2004, 2005 The Apache Software Foundation

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<module id="tapestry.ognl" version="4.0.0" package="org.apache.tapestry.services">

  Wrappers around the Object Graph Navigation Library.
  
  <!-- Currently, a single TypeConverter is allowed, specified as an app extension.  Need to augment that with
       a configuration point to specify as many as necessary. -->

  <service-point id="ExpressionEvaluator" interface="ExpressionEvaluator">
    <invoke-factory>
      <construct class="impl.ExpressionEvaluatorImpl">
        <set-service property="classFactory" service-id="tapestry.ClassFactory" />
        <set-object property="applicationSpecification" value="infrastructure:applicationSpecification"/>
        <set-configuration property="contributions" configuration-id="PropertyAccessors"/>
        <set-configuration property="nullHandlerContributions" configuration-id="NullHandlers"/>
      </construct>
    </invoke-factory>
  </service-point>

  <service-point id="ExpressionCache" interface="ExpressionCache">
    <invoke-factory>
      <construct class="impl.ExpressionCacheImpl" initialize-method="initializeService">
        <event-listener service-id="tapestry.ResetEventHub"/>
        <event-listener service-id="tapestry.describe.ReportStatusHub"/>
        <set-service property="evaluator" service-id="ExpressionEvaluator"/>
      </construct>
    </invoke-factory>
  </service-point>
  
  <configuration-point id="NullHandlers">
    
    Defines handler objects mapped to particular classes. OGNL NullHandler objects
    allow specifying how nulls are handled within OGNL expressions on a class-by-class
    basis.
    
    <schema>
      
      <element name="null-handler">
        
        <attribute name="class" required="true" translator="class">
          The class for which the null handler will be used.
        </attribute>
        
        <attribute name="object" required="true" translator="object">
          An object implementing the OGNL NullHandler interface.
        </attribute>
        
        <conversion class="impl.NullHandlerContribution">
          <map attribute="class" property="subjectClass"/>
          <map attribute="object" property="handler"/>
        </conversion>
      </element>
      
    </schema>
  </configuration-point>  
  
  <configuration-point id="PropertyAccessors">
    
    Defines accessor objects mapped to particular classes. OGNL property accessors
    allow for additional properties to be applied to objects beyond those
    provided by standard JavaBeans naming conventions.
    
    <schema>
      
      <element name="accessor">
        
        <attribute name="class" required="true" translator="class">
          The class for which the accessor will be used.
        </attribute>
        
        <attribute name="object" required="true" translator="object">
          An object implementing the OGNL PropertyAccessor interface.
        </attribute>
        
        <conversion class="impl.PropertyAccessorContribution">
          <map attribute="class" property="subjectClass"/>
          <map attribute="object" property="accessor"/>
        </conversion>
      </element>
      
    </schema>
  </configuration-point>
  
  <contribution configuration-id="PropertyAccessors">
    
    <accessor class="org.apache.tapestry.IBeanProvider" object="instance:org.apache.tapestry.bean.BeanProviderPropertyAccessor"/>
    <accessor class="org.apache.tapestry.listener.ListenerMap" object="instance:org.apache.tapestry.listener.ListenerMapPropertyAccessor"/>
  </contribution>
  
</module>
New to GrepCode? Check out our FAQ X