private static void doParseLayoutAnnotations(AnnotatedElement annotatedElement, LayoutModelBuilder builder) { Password passwordAnnotation = annotatedElement.getAnnotation(Password.class); if (passwordAnnotation != null) { builder.asPassword(); } Text textAnnotation = annotatedElement.getAnnotation(Text.class); if (textAnnotation != null) { builder.asText(); } }
private static void doParseLayoutAnnotations(WithAnnotations annotatedElement, LayoutModelBuilder builder) { java.util.Optional<Password> passwordAnnotation = annotatedElement.getAnnotation(Password.class); if (passwordAnnotation.isPresent()) { builder.asPassword(); } java.util.Optional<Text> textAnnotation = annotatedElement.getAnnotation(Text.class); if (textAnnotation.isPresent()) { builder.asText(); } }
@Test public void invalidLayoutTextForComponentId() { expectedException.expect(IllegalModelDefinitionException.class); expectedException.expectMessage(COMPONENT_ID_ERROR_PREFIX + "is also declared as 'Text'"); when(invalidParameterModel.isComponentId()).thenReturn(true); when(invalidParameterModel.getLayoutModel()).thenReturn(Optional.of(LayoutModel.builder().asText().build())); mockParameters(operationModel, invalidParameterModel); validate(extensionModel, validator); }
private static void doParseLayoutAnnotations(WithAnnotations annotatedElement, LayoutModelBuilder builder) { java.util.Optional<Password> passwordAnnotation = annotatedElement.getAnnotation(Password.class); if (passwordAnnotation.isPresent()) { builder.asPassword(); } java.util.Optional<Text> textAnnotation = annotatedElement.getAnnotation(Text.class); if (textAnnotation.isPresent()) { builder.asText(); } }
private static void doParseLayoutAnnotations(AnnotatedElement annotatedElement, LayoutModelBuilder builder) { Password passwordAnnotation = annotatedElement.getAnnotation(Password.class); if (passwordAnnotation != null) { builder.asPassword(); } Text textAnnotation = annotatedElement.getAnnotation(Text.class); if (textAnnotation != null) { builder.asText(); } }