Package org.springframework.roo.model

Examples of org.springframework.roo.model.JavaType


     * @return a MID produced by {@link #createLocalIdentifier(JavaType, Path)}
     *         for the extracted Java type in the extract Path (never null)
     */
    protected String getLocalMid(
            final MemberHoldingTypeDetails memberHoldingTypeDetails) {
        final JavaType governorType = memberHoldingTypeDetails.getName();

        // Extract out the metadata provider class (we need this later to
        // extract just the Path it is located in)
        final String providesType = MetadataIdentificationUtils
                .getMetadataClass(memberHoldingTypeDetails
View Full Code Here


                        + upstreamDependency + "') for metadata provider "
                        + getClass().getName());

        // A physical Java type has changed, and determine what the
        // corresponding local metadata identification string would have been
        final JavaType javaType = PhysicalTypeIdentifier
                .getJavaType(upstreamDependency);
        final LogicalPath path = PhysicalTypeIdentifier
                .getPath(upstreamDependency);
        return createLocalIdentifier(javaType, path);
    }
View Full Code Here

            final Expression init = fd.getVariables().get(0).getInit();

            // Resolve imports (ROO-1505)
            if (init instanceof ObjectCreationExpr) {
                final ObjectCreationExpr ocr = (ObjectCreationExpr) init;
                final JavaType typeToImport = JavaParserUtils.getJavaTypeNow(
                        compilationUnitServices, ocr.getType(), null);
                final NameExpr nameExpr = JavaParserUtils.importTypeIfRequired(
                        compilationUnitServices.getEnclosingTypeName(),
                        compilationUnitServices.getImports(), typeToImport);
                final ClassOrInterfaceType classOrInterfaceType = JavaParserUtils
                        .getClassOrInterfaceType(nameExpr);
                ocr.setType(classOrInterfaceType);

                if (typeToImport.getParameters().size() > 0) {
                    final List<Type> initTypeArgs = new ArrayList<Type>();
                    finalType.setTypeArgs(initTypeArgs);
                    for (final JavaType parameter : typeToImport
                            .getParameters()) {
                        initTypeArgs.add(JavaParserUtils.importParametersForType(
                                compilationUnitServices.getEnclosingTypeName(),
                                compilationUnitServices.getImports(), parameter));
                    }
View Full Code Here

        fieldType = JavaParserUtils.getJavaType(compilationUnitServices, type,
                typeParameters);

        // Convert into an array if this variable ID uses array notation
        if (var.getId().getArrayCount() > 0) {
            fieldType = new JavaType(fieldType.getFullyQualifiedTypeName(), var
                    .getId().getArrayCount() + fieldType.getArray(),
                    fieldType.getDataType(), fieldType.getArgName(),
                    fieldType.getParameters());
        }
View Full Code Here

    }

    @Override
    protected String getGovernorPhysicalTypeIdentifier(
            final String metadataIdentificationString) {
        final JavaType javaType = JsfApplicationBeanMetadata
                .getJavaType(metadataIdentificationString);
        final LogicalPath path = JsfApplicationBeanMetadata
                .getPath(metadataIdentificationString);
        return PhysicalTypeIdentifier.createIdentifier(javaType, path);
    }
View Full Code Here

        if (governorHasMethod(methodName, parameterTypes)) {
            return null;
        }

        findMethod.copyAdditionsTo(builder, governorTypeDetails);
        final JavaType returnType = identifierAccessor.getReturnType();

        builder.getImportRegistrationResolver().addImports(returnType,
                FACES_CONTEXT, UI_COMPONENT);

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder
                .appendFormalLine("if (value == null || value.length() == 0) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("return null;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine(returnType.getSimpleTypeName() + " "
                + ID_FIELD_NAME + " = "
                + getJavaTypeConversionString(returnType) + ";");
        bodyBuilder.appendFormalLine("return " + findMethod.getMethodCall()
                + ";");
View Full Code Here

                .getIdentifierFields(entity);
        if (idFields.isEmpty()) {
            return null;
        }
        final FieldMetadata idField = idFields.get(0);
        final JavaType idType = persistenceMemberLocator
                .getIdentifierType(entity);
        if (idType == null) {
            return null;
        }
        metadataDependencyRegistry
View Full Code Here

    }

    @Override
    protected String getGovernorPhysicalTypeIdentifier(
            final String metadataIdentificationString) {
        final JavaType javaType = JsfConverterMetadata
                .getJavaType(metadataIdentificationString);
        final LogicalPath path = JsfConverterMetadata
                .getPath(metadataIdentificationString);
        return PhysicalTypeIdentifier.createIdentifier(javaType, path);
    }
View Full Code Here

    @Override
    protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
        // Determine the governor for this ITD, and whether any metadata is even
        // hoping to hear about changes to that JavaType and its ITDs
        final JavaType governor = itdTypeDetails.getName();
        final String localMid = entityToConverterMidMap.get(governor);
        if (localMid != null) {
            return localMid;
        }
View Full Code Here

            final PhysicalTypeMetadata governorPhysicalTypeMetadata,
            final String itdFilename) {
        // We need to parse the annotation, which we expect to be present
        final JsfConverterAnnotationValues annotationValues = new JsfConverterAnnotationValues(
                governorPhysicalTypeMetadata);
        final JavaType entity = annotationValues.getEntity();
        if (!annotationValues.isAnnotationFound() || entity == null) {
            return null;
        }

        // Remember that this entity JavaType matches up with this metadata
        // identification string
        // Start by clearing any previous association
        final JavaType oldEntity = converterMidToEntityMap
                .get(metadataIdentificationString);
        if (oldEntity != null) {
            entityToConverterMidMap.remove(oldEntity);
        }
        entityToConverterMidMap.put(entity, metadataIdentificationString);
View Full Code Here

TOP

Related Classes of org.springframework.roo.model.JavaType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.