Package org.apache.commons.digester3.annotations

Examples of org.apache.commons.digester3.annotations.FromAnnotationsRuleModule


     */
    public void handle( A annotation, Method element, RulesBinder rulesBinder )
    {
        if ( SUPPORTED_ARGS != element.getParameterTypes().length )
        {
            DigesterRule rule = annotation.annotationType().getAnnotation( DigesterRule.class );

            rulesBinder.addError( "Methods annotated with digester annotation rule @%s must have just one argument",
                                  rule.reflectsRule().getName() );
            return;
        }

        Object explicitTypesObject = getAnnotationValue( annotation );
        if ( explicitTypesObject == null || !explicitTypesObject.getClass().isArray()
View Full Code Here


                           boolean fireOnBegin, RulesBinder rulesBinder )
    {
        if ( annotation.annotationType().isAnnotationPresent( DigesterRule.class )
            && annotation.annotationType().isAnnotationPresent( CreationRule.class ) )
        {
            rulesBinder.install( new FromAnnotationsRuleModule()
            {

                @Override
                protected void configureRules()
                {
View Full Code Here

     * Tests to make sure loader fails
     */
    @Test(expected = DigesterLoadingException.class)
    public void failsBecauseFailingDigesterLoaderHandlerFactory() {

        newLoader(new FromAnnotationsRuleModule()
        {

            @Override
            protected void configureRules()
            {
View Full Code Here

                           boolean fireOnBegin, RulesBinder rulesBinder )
    {
        if ( annotation.annotationType().isAnnotationPresent( DigesterRule.class )
            && annotation.annotationType().isAnnotationPresent( CreationRule.class ) )
        {
            rulesBinder.install( new FromAnnotationsRuleModule()
            {

                @Override
                protected void configureRules()
                {
View Full Code Here

    @Override
    protected Collection<RulesModule> getAuxModules()
    {
        Collection<RulesModule> modules = new Stack<RulesModule>();
        modules.add( new FromAnnotationsRuleModule()
        {

            @Override
            protected void configureRules()
            {
View Full Code Here

    @Test
    public void basicConstructorViaAnnotations()
        throws Exception
    {
        succesfullConstructor( new FromAnnotationsRuleModule()
        {

            @Override
            protected void configureRules()
            {
View Full Code Here

        dateConverter.setPatterns( new String[] { "yyyy-MM-dd'T'HH:mm" } );
        ConvertUtils.register( dateConverter, Date.class );

        String filename = args[0];

        Digester digester = newLoader( new FromAnnotationsRuleModule()
        {

            @Override
            protected void configureRules()
            {
View Full Code Here

                Annotation[][] parameterAnnotations = method.getParameterAnnotations();
                Class<?>[] parameterTypes = method.getParameterTypes();
                for ( int i = 0; i < parameterTypes.length; i++ )
                {
                    visitElements( new MethodArgument( i, parameterTypes[i], parameterAnnotations[i] ) );
                }
            }
        }
    }
View Full Code Here

     */
    @Test
    public void testElement()
        throws SAXException, ParserConfigurationException, IOException
    {
        Digester digester = newLoader( new AbstractRulesModule()
        {

            @Override
            protected void configure()
            {
View Full Code Here

     */
    @Test
    public void testDocumentFragment()
        throws SAXException, ParserConfigurationException, IOException
    {
        Digester digester = newLoader( new AbstractRulesModule()
        {

            @Override
            protected void configure()
            {
View Full Code Here

TOP

Related Classes of org.apache.commons.digester3.annotations.FromAnnotationsRuleModule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.