private DatasetFilter readDatasetFilterElement ( DatasetSource parentDatasetSource , Element dsFilterElement ) { String name = dsFilterElement . getAttributeValue ( "name" ) ; String type = dsFilterElement . getAttributeValue ( "type" ) ; String matchPattern = dsFilterElement . getAttributeValue ( "matchPattern" ) ; DatasetFilter dsFilter = new DatasetFilter ( parentDatasetSource , name , DatasetFilter . Type . getType ( type ) , matchPattern ) ; String matchPatternTarget = dsFilterElement . getAttributeValue ( "matchPatternTarget" ) ; dsFilter . setMatchPatternTarget ( matchPatternTarget ) ; if ( dsFilterElement . getAttributeValue ( "applyToCollectionDatasets" ) != null ) { boolean applyToCollectionDatasets = Boolean . valueOf ( dsFilterElement . getAttributeValue ( "applyToCollectionDatasets" ) ) . booleanValue ( ) ; dsFilter . setApplyToCollectionDatasets ( applyToCollectionDatasets ) ; } if ( dsFilterElement . getAttributeValue ( "applyToAtomicDatasets" ) != null ) { boolean applyToAtomicDatasets = Boolean . valueOf ( dsFilterElement . getAttributeValue ( "applyToAtomicDatasets" ) ) . booleanValue ( ) ; dsFilter . setApplyToAtomicDatasets ( applyToAtomicDatasets ) ; } if ( dsFilterElement . getAttributeValue ( "rejectMatchingDatasets" ) != null ) { boolean rejectMatchingDatasets = Boolean . valueOf ( dsFilterElement . getAttributeValue ( "rejectMatchingDatasets" ) ) . booleanValue ( ) ; dsFilter . setRejectMatchingDatasets ( rejectMatchingDatasets ) ; } return ( dsFilter ) ; }
Return a DatasetFilter when given a datasetFilter JDOM element .