private Digester configureDigester ( final Digester digester ) { /* * We use the context class loader to resolve classes. This fixes * ClassNotFoundExceptions on Geronimo. */ digester . setUseContextClassLoader ( true ) ; /* * Parse RewriteRules */ digester . addObjectCreate ( "pretty-config/rewrite" , RewriteRule . class ) ; digester . addSetProperties ( "pretty-config/rewrite" ) ; digester . addSetNext ( "pretty-config/rewrite" , "addRewriteRule" ) ; /* * Create Mapping Object */ digester . addObjectCreate ( "pretty-config/url-mapping" , UrlMapping . class ) ; digester . addSetProperties ( "pretty-config/url-mapping" ) ; digester . addCallMethod ( "pretty-config/url-mapping/pattern" , "setPattern" , 1 ) ; digester . addCallParam ( "pretty-config/url-mapping/pattern" , 0 , "value" ) ; digester . addCallMethod ( "pretty-config/url-mapping/pattern" , "setPattern" , 0 ) ; /* * Parse View Id */ digester . addCallMethod ( "pretty-config/url-mapping/view-id" , "setViewId" , 1 ) ; digester . addCallParam ( "pretty-config/url-mapping/view-id" , 0 , "value" ) ; digester . addCallMethod ( "pretty-config/url-mapping/view-id" , "setViewId" , 0 ) ; /* * Parse Path Validators */ digester . addObjectCreate ( "pretty-config/url-mapping/pattern/validate" , PathValidator . class ) ; digester . addSetProperties ( "pretty-config/url-mapping/pattern/validate" ) ; digester . addSetNext ( "pretty-config/url-mapping/pattern/validate" , "addPathValidator" ) ; /* * Parse Query Params */ digester . addObjectCreate ( "pretty-config/url-mapping/query-param" , QueryParameter . class ) ; digester . addSetProperties ( "pretty-config/url-mapping/query-param" ) ; digester . addCallMethod ( "pretty-config/url-mapping/query-param" , "setExpression" , 0 ) ; digester . addSetNext ( "pretty-config/url-mapping/query-param" , "addQueryParam" ) ; /* * Parse Action Methods */ digester . addObjectCreate ( "pretty-config/url-mapping/action" , UrlAction . class ) ; digester . addSetProperties ( "pretty-config/url-mapping/action" ) ; digester . addCallMethod ( "pretty-config/url-mapping/action" , "setAction" , 0 ) ; digester . addSetNext ( "pretty-config/url-mapping/action" , "addAction" ) ; /* * Add Mapping to Builder */ digester . addSetNext ( "pretty-config/url-mapping" , "addMapping" ) ; return digester ; }
Configure the digester . Assume that the builder object will be pushed after this method is called .