private static void parseFilters ( final FilterType filterType , final WebApp webApp ) { final WebAppFilter filter = new WebAppFilter ( ) ; if ( filterType . getFilterName ( ) != null ) { filter . setFilterName ( filterType . getFilterName ( ) . getValue ( ) ) ; } if ( filterType . getFilterClass ( ) != null ) { filter . setFilterClass ( filterType . getFilterClass ( ) . getValue ( ) ) ; } if ( filterType . getAsyncSupported ( ) != null ) { filter . setAsyncSupported ( filterType . getAsyncSupported ( ) . isValue ( ) ) ; } webApp . addFilter ( filter ) ; List < ParamValueType > initParams = filterType . getInitParam ( ) ; if ( initParams != null && initParams . size ( ) > 0 ) { for ( ParamValueType initParamElement : initParams ) { final WebAppInitParam initParam = new WebAppInitParam ( ) ; initParam . setParamName ( initParamElement . getParamName ( ) . getValue ( ) ) ; initParam . setParamValue ( initParamElement . getParamValue ( ) . getValue ( ) ) ; filter . addInitParam ( initParam ) ; } } List < DescriptionType > description = filterType . getDescription ( ) ; for ( DescriptionType descriptionType : description ) { filter . addDispatcherType ( DispatcherType . valueOf ( descriptionType . getValue ( ) ) ) ; } }
Parses filters and filter mappings out of web . xml .