test_class.declarator: treeNodeService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private IdmTreeNodeService treeNodeService;
test_class.type: IdmTreeNodeService
test_class.var_name: treeNodeService
test_class.file: Realization/backend/core/core-impl/src/test/java/eu/bcvsolutions/idm/core/generator/treenode/TreeNodeCodeGeneratorTest.java
test_class.identifier: TreeNodeCodeGeneratorTest
test_class.superclass: extends AbstractGeneratorTest
test_case.body: @Test
  	public void testDiacritics() {
  		IdmTreeTypeDto type = getHelper().createTreeType();
  		IdmTreeNodeDto node = new IdmTreeNodeDto();
  		node.setTreeType(type.getId());
  		node.setName("abcdřřřžžžééé");
  		
  		IdmGenerateValueDto generator = this.createGenerator(getDtoType(), getGeneratorType(), null, 1, null);
  		
  		IdmTreeNodeDto generated = valueGeneratorManager.generate(node);
  		
  		assertNotNull(generated.getCode());
  		assertEquals("abcdrrrzzzeee", generated.getCode());
  
  		generatedAttributeService.delete(generator);
  	}
test_case.class_method_signature: TreeNodeCodeGeneratorTest.testDiacritics()
test_case.full_signature: @Test public void testDiacritics()
test_case.identifier: testDiacritics
test_case.invocations: createTreeType getHelper setTreeType getId setName createGenerator getDtoType getGeneratorType generate assertNotNull getCode assertEquals getCode delete
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDiacritics()
focal_class.declarator: GENERATOR_NAME = "core-tree-node-code-value-generator"
focal_class.modifier: public static final
focal_class.original_string: public static final String GENERATOR_NAME = "core-tree-node-code-value-generator";
focal_class.type: String
focal_class.var_name: GENERATOR_NAME
focal_class.file: Realization/backend/core/core-impl/src/main/java/eu/bcvsolutions/idm/core/generator/treenode/TreeNodeCodeGenerator.java
focal_class.identifier: TreeNodeCodeGenerator
focal_class.class_method_signature: TreeNodeCodeGenerator.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: TreeNodeCodeGenerator.generate(IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator)
focal_class.full_signature: @Override public IdmTreeNodeDto generate(IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator)
focal_class.identifier: generate
focal_class.modifiers: @Override public
focal_class.parameters: (IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator)
focal_class.return: IdmTreeNodeDto
focal_class.signature: IdmTreeNodeDto generate(IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator)
focal_class.superclass: extends AbstractValueGenerator<IdmTreeNodeDto>
focal_method.body: @Override
  	public IdmTreeNodeDto generate(IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator) {
  		Assert.notNull(dto, "DTO is required.");
  		Assert.notNull(valueGenerator, "Value generator is required.");
  
  		// Code is based from name
  		String code = dto.getName();
  
  		if (code == null) {
  			return dto;
  		}
  	
  		// if exists email and configuration doesn't allow regenerate return dto
  		if (!valueGenerator.isRegenerateValue() && StringUtils.isNotEmpty(dto.getCode())) {
  			return dto;
  		}
  		
  		code = StringUtils.stripAccents(code);
  		code = StringUtils.deleteWhitespace(code);
  		code = code.toLowerCase();
  
  		dto.setCode(code);
  		return dto;
  	}
focal_method.class_method_signature: TreeNodeCodeGenerator.generate(IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator)
focal_method.full_signature: @Override public IdmTreeNodeDto generate(IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator)
focal_method.identifier: generate
focal_method.invocations: notNull notNull getName isRegenerateValue isNotEmpty getCode stripAccents deleteWhitespace toLowerCase setCode
focal_method.modifiers: @Override public
focal_method.parameters: (IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator)
focal_method.return: IdmTreeNodeDto
focal_method.signature: IdmTreeNodeDto generate(IdmTreeNodeDto dto, IdmGenerateValueDto valueGenerator)