@Override public PluginDef apply(@Nullable TypeInstance input) { if (input.properties().size() == 0) { return new PluginDef((String) input.value(), Collections.<String>emptyList()); } else { if ( input.properties().size() == 1 ) { return new PluginDef((String) input.properties().get(0).value().value(), Collections.<String>emptyList()); } else { return new PluginDef((String) input.properties().get(0).value().value(), Lists.transform(input.properties().get(1).values(), new Function<TypeInstance, String>() { @Nullable @Override public String apply(@Nullable TypeInstance input) { return (String) input.value(); } } )); } } } }
@Nullable @Override public String apply(@Nullable TypeInstance input) { return (String) input.value(); } }
private static <T> Object findProperty(AnnotationRef annotationRef, String propName, Function<TypeInstance, T> convert) { // annotationRef.structuredValue().properties().get(0).values().get(0).value() for (TypeInstanceProperty typeInstanceProperty : annotationRef.structuredValue().properties()) { if (typeInstanceProperty.name().equalsIgnoreCase(propName)) { if (typeInstanceProperty.isArray()) { return toValueList(convert, typeInstanceProperty.values()); } else { return convert.apply(typeInstanceProperty.value()); } } } return null; }
@Nullable @Override public Object apply(@Nullable TypeInstance input) { return input.value(); } });
@Override public PluginDef apply(@Nullable TypeInstance input) { if (input.properties().size() == 0) { return new PluginDef((String) input.value(), Collections.<String>emptyList()); } else { if (input.properties().size() == 1) { return new PluginDef((String) input.properties().get(0).value().value(), Collections.<String>emptyList()); } else { return new PluginDef((String) input.properties().get(0).value().value(), Lists.transform(input.properties().get(1) .values(), new Function<TypeInstance, String>() { @Nullable @Override public String apply(@Nullable TypeInstance input) { return (String) input.value(); } } )); } } } }
@Nullable @Override public Object apply(@Nullable TypeInstance input) { return input.value(); } });
@Override public List<String> getAuthorizationGrants() { if (!"oauth_2_0".equalsIgnoreCase(getName())) { return Collections.emptyList(); } TypeInstance structuredValue = this.securitySchemeRef.structuredValue(); if (structuredValue == null) { return Collections.emptyList(); } List<String> authorizationGrants = new ArrayList<>(); List<TypeInstanceProperty> properties = structuredValue.properties(); for (TypeInstanceProperty property : properties) { if ("authorizationGrants".equalsIgnoreCase(property.name())) { authorizationGrants.add(property.value().value().toString()); } } return authorizationGrants; } }
@Nullable @Override public String apply(@Nullable TypeInstance input) { return (String) input.value(); } }
private static Object findProperty(AnnotationRef annotationRef, String propName) { // annotationRef.structuredValue().properties().get(0).values().get(0).value() for (TypeInstanceProperty typeInstanceProperty : annotationRef.structuredValue().properties()) { if (typeInstanceProperty.name().equalsIgnoreCase(propName)) { if (typeInstanceProperty.isArray()) { return toValueList(typeInstanceProperty.values()); } else { return typeInstanceProperty.value().value(); } } } return null; }
@Nullable @Override public Boolean apply(@Nullable TypeInstance input) { return (Boolean) input.value(); } }
private static Object findProperty(AnnotationRef annotationRef, String propName) { // annotationRef.structuredValue().properties().get(0).values().get(0).value() for (TypeInstanceProperty typeInstanceProperty : annotationRef.structuredValue().properties()) { if (typeInstanceProperty.name().equalsIgnoreCase(propName)) { if (typeInstanceProperty.isArray()) { return toValueList(typeInstanceProperty.values()); } else { return typeInstanceProperty.value().value(); } } } return null; }
@Nullable @Override public String apply(@Nullable TypeInstance input) { return (String) input.value(); } }
public String getJavaName() { String javaName = null; if (Config.getOverrideNamingLogicWith() == OverrideNamingLogicWith.DISPLAY_NAME && !StringUtils.isEmpty(this.getDisplayName())) { javaName = NamingHelper.getParameterName(this.getDisplayName()); } else if (Config.getOverrideNamingLogicWith() == OverrideNamingLogicWith.ANNOTATION) { for (AnnotationRef annotation : this.getAnnotations()) { if ("(javaName)".equals(annotation.name())) { javaName = String.valueOf(annotation.structuredValue().value()); break; } } } if (StringUtils.isEmpty(javaName)) { javaName = NamingHelper.getParameterName(this.getName()); } return javaName; } }
public static String getActionName(ApiActionMetadata apiActionMetadata) { if (Config.getOverrideNamingLogicWith() == OverrideNamingLogicWith.DISPLAY_NAME && !StringUtils.isEmpty(apiActionMetadata.getDisplayName())) { return StringUtils.uncapitalize(cleanNameForJava(apiActionMetadata.getDisplayName())); } else if (Config.getOverrideNamingLogicWith() == OverrideNamingLogicWith.ANNOTATION) { for (AnnotationRef annotation : apiActionMetadata.getAnnotations()) { if ("(javaName)".equals(annotation.name())) { return String.valueOf(annotation.structuredValue().value()); } } } if (Config.getMethodsNamingLogic() == MethodsNamingLogic.RESOURCES) { return getActionNameFromResources(apiActionMetadata.getParent().getResource(), apiActionMetadata.getResource(), apiActionMetadata.getActionType()); } return getActionNameFromObjects(apiActionMetadata); }
for (AnnotationRef annotation : objectProperty.annotations()) { if ("(javaName)".equals(annotation.name())) { fieldName = String.valueOf(annotation.structuredValue().value()); break; if ("(isSensitive)".equals(annotation.name()) && Boolean.TRUE.equals(annotation.structuredValue().value())) { excludeFieldsFromToString.add(fieldName);