@Override public String getAsText() { final JavaSymbolName obj = (JavaSymbolName) getValue(); if (obj == null) { return null; } return obj.getSymbolName(); }
@Override public String toString() { return type.getFullyQualifiedTypeName() + "." + field.getSymbolName(); }
public static boolean isDecimalType(final JavaType javaType) { return javaType.equals(BIG_DECIMAL) || isDoubleOrFloat(javaType); }
protected JavaType getCustomRepositoryJavaTypeFor(JavaType repositoryType) { String javaTypeName = repositoryType.getPackage().getFullyQualifiedPackageName().concat(".") .concat(repositoryType.getSimpleTypeName()).concat("Custom"); return new JavaType(javaTypeName, repositoryType.getModule()); }
/** * Returns the non-primitive type that represent this type if it is primitive. Otherwise, returns itself. * @return */ public JavaType toObjectType() { if (isPrimitive()) { return new JavaType(getFullyQualifiedTypeName(), getArray(), DataType.TYPE, getArgName(), getParameters(), getModule()); } return this; }
public void addEnumAttribute(final String key, final String fullyQualifiedTypeName, final String enumConstant) { final EnumDetails details = new EnumDetails(new JavaType(fullyQualifiedTypeName), new JavaSymbolName(enumConstant)); addAttribute(new EnumAttributeValue(new JavaSymbolName(key), details)); }
/** Return {@link JavaType} which is a Widcard of generics with "supper" * value. * * By exampe: JavaType.listOf(JavaType.wilcardSupper(JavaType.NUMBER)) generates List<? supper Number> * * @param supperOf * @return */ public static JavaType wilcardSupper(final JavaType supperOf) { return new JavaType(supperOf.getFullyQualifiedTypeName(), 0, DataType.TYPE, JavaType.WILDCARD_SUPER_ARG, null); }
/** * Constructor * * @param type the parameter's type (required) * @param name the parameter's name (required) */ public MethodParameter(final JavaType type, final String name) { this(type, new JavaSymbolName(name)); }
/** * Convenience constructor that takes a {@link Class} for the annotation * type * * @param governorMetadata to parse (can be <code>null</code>) * @param annotationType the annotation class (required) */ protected AbstractAnnotationValues( final MemberHoldingTypeDetailsMetadataItem<?> governorMetadata, final Class<?> annotationType) { this(governorMetadata, new JavaType(annotationType)); }
/** * Indicates whether a field or variable of this type can contain multiple * values * * @return see above * @since 1.2.0 */ public boolean isMultiValued() { return isCommonCollectionType() || isArray(); }
/** * @return the symbol name in human readable form */ public String getReadableSymbolName() { final String camelCase = symbolName; return getReadableSymbolName(camelCase); }
/** * Returns a {@link JavaType} for a _wrapperType_ with generic: * JavaType.wrapperWilcard(JavaType.LIST) return List<T> * * @param elementType the type of element in the list (required) * @return a non `null` type * @since 2.0.0 */ public static JavaType wrapperGenericType(final JavaType wrapperType) { return wrapperOf(wrapperType, GENERIC_TYPE); }
public static boolean isLegalJavaName(final String name) { try { assertJavaNameLegal(name); } catch (final IllegalArgumentException e) { return false; } return true; }
/** * Constructor for a builder initialised with the given contents * * @param existing can be <code>null</code> */ public CustomDataBuilder(final CustomData existing) { append(existing); }
public void addImports(final JavaType... typesToImport) { for (final JavaType typeToImport : typesToImport) { addImport(typeToImport); } }
@Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("key: ").append(type.getFullyQualifiedTypeName()); builder.append(", value: ").append(name.getSymbolName()); return builder.toString(); } }
/** * Constructor for no initial attribute values * * @param annotationType the fully-qualified name of the annotation type * (required) */ public AnnotationMetadataBuilder(final String annotationType) { this(new JavaType(annotationType)); }
/** * Returns a {@link JavaType} for a _wrapperType_ with wildcard: * JavaType.wrapperWilcard(JavaType.LIST) return List<?> * * @param elementType the type of element in the list (required) * @return a non-<code>null</code> type * @since 2.0.0 */ public static JavaType wrapperWilcard(final JavaType wrapperType) { return wrapperOf(wrapperType, WILDCARD_NEITHER); }
/** * Return JPQLQuery JavaType for required entity * * @param entityType * @return */ private JavaType getJPQLQueryFor(JavaType entityType) { return JavaType.wrapperOf(QUERYDSL_JPQLQUERY, entityType); }