Package org.springframework.roo.classpath.details

Examples of org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails


        return simpleTypeNameTypesMap.get(simpleTypeName);
    }

    public void removeType(final String typeIdentifier) {
        Validate.notBlank(typeIdentifier, "Physical type identifier required");
        final ClassOrInterfaceTypeDetails cid = midToTypeDetailsMap
                .get(typeIdentifier);
        if (cid != null) {
            typeNameToMidMap.remove(cid.getName().getFullyQualifiedTypeName());
            typeNameToModuleFilePathMap.remove(cid.getName()
                    .getFullyQualifiedTypeName());
            typeNameToModuleNameMap.remove(cid.getName()
                    .getFullyQualifiedTypeName());
        }
        final String filePath = typeIdentifierToFilePathMap.get(typeIdentifier);
        if (filePath != null) {
            typeFilePathToMidMap.remove(filePath);
View Full Code Here


        final DbreMetadata dbreMetadata = new DbreMetadata(
                metadataIdentificationString, aspectName,
                governorPhysicalTypeMetadata, annotationValues,
                identifierHolder, versionField, managedEntities, database);
        final ClassOrInterfaceTypeDetails updatedGovernor = dbreMetadata
                .getUpdatedGovernor();
        if (updatedGovernor != null) {
            typeManagementService.createOrUpdateTypeOnDisk(updatedGovernor);
        }
        return dbreMetadata;
View Full Code Here

                "Java source code details unavailable for type %s",
                PhysicalTypeIdentifier.getFriendlyName(physicalTypeIdentifier));
        Validate.isInstanceOf(ClassOrInterfaceTypeDetails.class, ptd,
                "Java source code is immutable for type %s",
                PhysicalTypeIdentifier.getFriendlyName(physicalTypeIdentifier));
        final ClassOrInterfaceTypeDetails cid = (ClassOrInterfaceTypeDetails) ptd;
        return cid.getSuperclass();
    }
View Full Code Here

    @Reference private TypeManagementService typeManagementService;

    public void annotateType(final JavaType javaType) {
        Validate.notNull(javaType, "Java type required");

        final ClassOrInterfaceTypeDetails cid = typeLocationService
                .getTypeDetails(javaType);
        if (cid == null) {
            throw new IllegalArgumentException("Cannot locate source for '"
                    + javaType.getFullyQualifiedTypeName() + "'");
        }

        if (MemberFindingUtils.getAnnotationOfType(cid.getAnnotations(),
                ROO_OP4J) == null) {
            final AnnotationMetadataBuilder annotationBuilder = new AnnotationMetadataBuilder(
                    ROO_OP4J);
            final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                    cid);
View Full Code Here

     * @param entity the entity to lookup required
     * @return the type details (never null; throws an exception if it cannot be
     *         obtained or parsed)
     */
    private ClassOrInterfaceTypeDetails getEntity(final JavaType entity) {
        final ClassOrInterfaceTypeDetails cid = typeLocationService
                .getTypeDetails(entity);
        Validate.notNull(cid,
                "Java source code details unavailable for type %s", cid);
        return cid;
    }
View Full Code Here

        Validate.notNull(entity,
                "Entity to produce an integration test for is required");

        // Verify the requested entity actually exists as a class and is not
        // abstract
        final ClassOrInterfaceTypeDetails cid = getEntity(entity);
        Validate.isTrue(!Modifier.isAbstract(cid.getModifier()),
                "Type %s is abstract", entity.getFullyQualifiedTypeName());

        final LogicalPath path = PhysicalTypeIdentifier.getPath(cid
                .getDeclaredByMetadataId());
        dataOnDemandOperations.newDod(entity,
                new JavaType(entity.getFullyQualifiedTypeName()
                        + "DataOnDemand"));
View Full Code Here

        // Get the entity so we can hopefully make a demo method that will be
        // usable
        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();

        final ClassOrInterfaceTypeDetails cid = typeLocationService
                .getTypeDetails(entity);
        if (cid != null) {
            final MemberDetails memberDetails = memberDetailsScanner
                    .getMemberDetails(
                            IntegrationTestOperationsImpl.class.getName(), cid);
View Full Code Here

        final List<AnnotationMetadataBuilder> methodAnnotations = new ArrayList<AnnotationMetadataBuilder>();
        methodAnnotations.add(new AnnotationMetadataBuilder(TEST));

        // Get the class so we can hopefully make a demo method that will be
        // usable
        final ClassOrInterfaceTypeDetails governorTypeDetails = typeLocationService
                .getTypeDetails(javaType);
        final MemberDetails memberDetails = memberDetailsScanner
                .getMemberDetails(this.getClass().getName(),
                        governorTypeDetails);
        for (final MemberHoldingTypeDetails typeDetails : memberDetails
View Full Code Here

     * Sets up the mock {@link RepositoryJpaLocator} and
     * {@link PersistenceMemberLocator} to return a mock repository for our test
     * entity.
     */
    private void setUpMockRepository() {
        final ClassOrInterfaceTypeDetails mockRepositoryDetails = mock(ClassOrInterfaceTypeDetails.class);
        final FieldMetadata mockFieldMetadata = mock(FieldMetadata.class);
        final JavaType mockRepositoryType = mock(JavaType.class);
        when(mockRepositoryType.getSimpleTypeName()).thenReturn("ClinicRepo");
        when(mockIdType.getFullyQualifiedTypeName()).thenReturn(
                Long.class.getName());
        when(mockRepositoryDetails.getName()).thenReturn(mockRepositoryType);
        when(mockFieldMetadata.getFieldType()).thenReturn(mockIdType);
        when(mockRepositoryLocator.getRepositories(mockTargetEntity))
                .thenReturn(Arrays.asList(mockRepositoryDetails));
    }
View Full Code Here

            @CliOption(key = "permitReservedWords", mandatory = false, unspecifiedDefaultValue = "false", specifiedDefaultValue = "true", help = "Indicates whether reserved words are ignored by Roo") final boolean permitReservedWords,
            @CliOption(key = "dateFormat", mandatory = false, unspecifiedDefaultValue = "MEDIUM", specifiedDefaultValue = "MEDIUM", help = "Indicates the style of the date format (ignored if dateTimeFormatPattern is specified)") final DateTime dateFormat,
            @CliOption(key = "timeFormat", mandatory = false, unspecifiedDefaultValue = "NONE", specifiedDefaultValue = "NONE", help = "Indicates the style of the time format (ignored if dateTimeFormatPattern is specified)") final DateTime timeFormat,
            @CliOption(key = "dateTimeFormatPattern", mandatory = false, help = "Indicates a DateTime format pattern such as yyyy-MM-dd hh:mm:ss a") final String pattern) {

        final ClassOrInterfaceTypeDetails javaTypeDetails = typeLocationService
                .getTypeDetails(typeName);
        Validate.notNull(javaTypeDetails,
                "The type specified, '%s', doesn't exist", typeName);

        final String physicalTypeIdentifier = javaTypeDetails
                .getDeclaredByMetadataId();
        final DateField fieldDetails = new DateField(physicalTypeIdentifier,
                fieldType, fieldName);
        fieldDetails.setNotNull(notNull);
        fieldDetails.setNullRequired(nullRequired);
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails

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.