test_class.declarator: DOUBLE_TOLERANCE = .00000001
test_class.modifier: private static final
test_class.original_string: private static final double DOUBLE_TOLERANCE = .00000001;
test_class.type: double
test_class.var_name: DOUBLE_TOLERANCE
test_class.declarator: LAYER_ID = "countries"
test_class.modifier: private static final
test_class.original_string: private static final String LAYER_ID = "countries";
test_class.type: String
test_class.var_name: LAYER_ID
test_class.declarator: REGION_ATTRIBUTE = "region"
test_class.modifier: private static final
test_class.original_string: private static final String REGION_ATTRIBUTE = "region";
test_class.type: String
test_class.var_name: REGION_ATTRIBUTE
test_class.declarator: NAME_ATTRIBUTE = "name"
test_class.modifier: private static final
test_class.original_string: private static final String NAME_ATTRIBUTE = "name";
test_class.type: String
test_class.var_name: NAME_ATTRIBUTE
test_class.declarator: ID_ATTRIBUTE = "id"
test_class.modifier: private static final
test_class.original_string: private static final String ID_ATTRIBUTE = "id";
test_class.type: String
test_class.var_name: ID_ATTRIBUTE
test_class.declarator: dispatcher
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private CommandDispatcher dispatcher;
test_class.type: CommandDispatcher
test_class.var_name: dispatcher
test_class.declarator: searchFeatureCommand
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private SearchFeatureCommand searchFeatureCommand;
test_class.type: SearchFeatureCommand
test_class.var_name: searchFeatureCommand
test_class.file: command/src/test/java/org/geomajas/command/feature/SearchFeatureCommandTest.java
test_class.identifier: SearchFeatureCommandTest
test_case.body: @Test
  	@DirtiesContext // @todo need to check why this is necessary, otherwise next test fails? (GetVectorTileCommandTest)
  	// probably cause by directly using the command service which has an injected security context
  	public void createFilterTest() throws Exception {
  		SearchFeatureRequest request = new SearchFeatureRequest();
  		request.setLayerId(LAYER_ID);
  		request.setCrs("EPSG:4326");
  		SearchCriterion searchCriterion = new SearchCriterion();
  		Filter filter;
  
  		// needs to be FidFilter when equals test on id
  		searchCriterion.setAttributeName(ID_ATTRIBUTE);
  		searchCriterion.setOperator("=");
  		searchCriterion.setValue("'1'");
  		request.setCriteria(new SearchCriterion[] {searchCriterion});
  		filter = searchFeatureCommand.createFilter(request, LAYER_ID);
  		Assert.assertTrue(filter instanceof Id);
  
  		// but *not* when other test
  		searchCriterion.setAttributeName(ID_ATTRIBUTE);
  		searchCriterion.setOperator("like");
  		searchCriterion.setValue("'%a%'");
  		request.setCriteria(new SearchCriterion[] {searchCriterion});
  		filter = searchFeatureCommand.createFilter(request, LAYER_ID);
  		Assert.assertFalse(filter instanceof Id);
  	}
test_case.class_method_signature: SearchFeatureCommandTest.createFilterTest()
test_case.full_signature: @Test @DirtiesContext // @todo need to check why this is necessary, otherwise next test fails? (GetVectorTileCommandTest) // probably cause by directly using the command service which has an injected security context public void createFilterTest()
test_case.identifier: createFilterTest
test_case.invocations: setLayerId setCrs setAttributeName setOperator setValue setCriteria createFilter assertTrue setAttributeName setOperator setValue setCriteria createFilter assertFalse
test_case.modifiers: @Test @DirtiesContext // @todo need to check why this is necessary, otherwise next test fails? (GetVectorTileCommandTest) // probably cause by directly using the command service which has an injected security context public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createFilterTest()
focal_class.declarator: log  = LoggerFactory.getLogger(SearchFeatureCommand.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger log  = LoggerFactory.getLogger(SearchFeatureCommand.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: configurationService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private ConfigurationService configurationService;
focal_class.type: ConfigurationService
focal_class.var_name: configurationService
focal_class.declarator: geoService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private GeoService geoService;
focal_class.type: GeoService
focal_class.var_name: geoService
focal_class.declarator: converter
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private DtoConverterService converter;
focal_class.type: DtoConverterService
focal_class.var_name: converter
focal_class.declarator: filterService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private FilterService filterService;
focal_class.type: FilterService
focal_class.var_name: filterService
focal_class.declarator: layerService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private VectorLayerService layerService;
focal_class.type: VectorLayerService
focal_class.var_name: layerService
focal_class.file: command/src/main/java/org/geomajas/command/feature/SearchFeatureCommand.java
focal_class.identifier: SearchFeatureCommand
focal_class.interfaces: implements CommandHasRequest<SearchFeatureRequest, SearchFeatureResponse>
focal_class.class_method_signature: SearchFeatureCommand.getEmptyCommandRequest()
focal_class.full_signature: @Override public SearchFeatureRequest getEmptyCommandRequest()
focal_class.identifier: getEmptyCommandRequest
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: SearchFeatureRequest
focal_class.signature: SearchFeatureRequest getEmptyCommandRequest()
focal_class.class_method_signature: SearchFeatureCommand.getEmptyCommandResponse()
focal_class.full_signature: @Override public SearchFeatureResponse getEmptyCommandResponse()
focal_class.identifier: getEmptyCommandResponse
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: SearchFeatureResponse
focal_class.signature: SearchFeatureResponse getEmptyCommandResponse()
focal_class.class_method_signature: SearchFeatureCommand.execute(SearchFeatureRequest request, SearchFeatureResponse response)
focal_class.full_signature: @Override public void execute(SearchFeatureRequest request, SearchFeatureResponse response)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (SearchFeatureRequest request, SearchFeatureResponse response)
focal_class.return: void
focal_class.signature: void execute(SearchFeatureRequest request, SearchFeatureResponse response)
focal_class.class_method_signature: SearchFeatureCommand.createFilter(SearchFeatureRequest request, String layerId)
focal_class.full_signature:  Filter createFilter(SearchFeatureRequest request, String layerId)
focal_class.identifier: createFilter
focal_class.parameters: (SearchFeatureRequest request, String layerId)
focal_class.return: Filter
focal_class.signature: Filter createFilter(SearchFeatureRequest request, String layerId)
focal_method.body: Filter createFilter(SearchFeatureRequest request, String layerId) throws GeomajasException {
  		Filter f = null;
  		VectorLayer layer = configurationService.getVectorLayer(layerId);
  		if (layer == null) {
  			throw new  GeomajasException(ExceptionCode.LAYER_NOT_FOUND, layerId);
  		}
  		String idName = layer.getLayerInfo().getFeatureInfo().getIdentifier().getName();
  		if (null != request.getCriteria()) {
  			for (SearchCriterion criterion : request.getCriteria()) {
  				Filter temp;
  				String attributeName = criterion.getAttributeName();
  				String operator = criterion.getOperator();
  				if ((SearchFeatureRequest.ID_ATTRIBUTE.equals(attributeName) || attributeName.equals(idName)) &&
  						(null == operator || "=".equals(operator))) {
  					temp = filterService.createFidFilter(new String[]{criterion.getValue()});
  				} else {
  					String c = criterion.toString().replace('*', '%').replace('?', '_');
  					temp = filterService.parseFilter(c);
  				}
  				if (f == null) {
  					f = temp;
  				} else {
  					f = filterService.createLogicFilter(f, request.getBooleanOperator(), temp);
  				}
  			}
  		}
  
  		// AND the layer filter
  		String filter = request.getFilter();
  		if (filter != null) {
  			if (f == null) {
  				f = filterService.parseFilter(filter);
  			} else {
  				f = filterService.createAndFilter(filterService.parseFilter(filter), f);
  			}
  		}
  
  		// If f is still null:
  		if (f == null) {
  			f = filterService.createTrueFilter();
  		}
  
  		return f;
  	}
focal_method.class_method_signature: SearchFeatureCommand.createFilter(SearchFeatureRequest request, String layerId)
focal_method.full_signature:  Filter createFilter(SearchFeatureRequest request, String layerId)
focal_method.identifier: createFilter
focal_method.invocations: getVectorLayer getName getIdentifier getFeatureInfo getLayerInfo getCriteria getCriteria getAttributeName getOperator equals equals equals createFidFilter getValue replace replace toString parseFilter createLogicFilter getBooleanOperator getFilter parseFilter createAndFilter parseFilter createTrueFilter
focal_method.parameters: (SearchFeatureRequest request, String layerId)
focal_method.return: Filter
focal_method.signature: Filter createFilter(SearchFeatureRequest request, String layerId)