Search in sources :

Example 76 with LogicalPath

use of org.springframework.roo.project.LogicalPath in project spring-roo by spring-projects.

the class JsonControllerIntegrationTestMetadataProviderImpl method getGovernorPhysicalTypeIdentifier.

@Override
protected String getGovernorPhysicalTypeIdentifier(final String metadataIdentificationString) {
    final JavaType javaType = JsonControllerIntegrationTestMetadata.getJavaType(metadataIdentificationString);
    final LogicalPath path = JsonControllerIntegrationTestMetadata.getPath(metadataIdentificationString);
    return PhysicalTypeIdentifier.createIdentifier(javaType, path);
}
Also used : JavaType(org.springframework.roo.model.JavaType) RooJavaType(org.springframework.roo.model.RooJavaType) LogicalPath(org.springframework.roo.project.LogicalPath)

Example 77 with LogicalPath

use of org.springframework.roo.project.LogicalPath in project spring-roo by spring-projects.

the class ThymeleafMetadataProviderImpl method getGovernorPhysicalTypeIdentifier.

@Override
protected String getGovernorPhysicalTypeIdentifier(final String metadataIdentificationString) {
    final JavaType javaType = ThymeleafMetadata.getJavaType(metadataIdentificationString);
    final LogicalPath path = ThymeleafMetadata.getPath(metadataIdentificationString);
    return PhysicalTypeIdentifier.createIdentifier(javaType, path);
}
Also used : RooJavaType(org.springframework.roo.model.RooJavaType) JpaJavaType(org.springframework.roo.model.JpaJavaType) JavaType(org.springframework.roo.model.JavaType) LogicalPath(org.springframework.roo.project.LogicalPath)

Example 78 with LogicalPath

use of org.springframework.roo.project.LogicalPath in project spring-roo by spring-projects.

the class JspMetadataListener method notify.

public void notify(final String upstreamDependency, String downstreamDependency) {
    if (MetadataIdentificationUtils.isIdentifyingClass(downstreamDependency)) {
        // been
        if (WebScaffoldMetadata.isValid(upstreamDependency)) {
            final JavaType javaType = WebScaffoldMetadata.getJavaType(upstreamDependency);
            final LogicalPath path = WebScaffoldMetadata.getPath(upstreamDependency);
            downstreamDependency = JspMetadata.createIdentifier(javaType, path);
        } else if (WebFinderMetadata.isValid(upstreamDependency)) {
            final JavaType javaType = WebFinderMetadata.getJavaType(upstreamDependency);
            final LogicalPath path = WebFinderMetadata.getPath(upstreamDependency);
            downstreamDependency = JspMetadata.createIdentifier(javaType, path);
        }
        // later on)
        if (getMetadataDependencyRegistry().getDownstream(upstreamDependency).contains(downstreamDependency)) {
            return;
        }
    } else if (MetadataIdentificationUtils.isIdentifyingInstance(upstreamDependency)) {
        // This is the generic fallback listener, ie from
        // MetadataDependencyRegistry.addListener(this) in the activate()
        // method
        // Get the metadata that just changed
        final MetadataItem metadataItem = getMetadataService().get(upstreamDependency);
        // detected
        if (metadataItem == null || !metadataItem.isValid() || !(metadataItem instanceof ItdTypeDetailsProvidingMetadataItem)) {
            // let's gracefully abort
            return;
        }
        // Let's ensure we have some ITD type details to actually work with
        final ItdTypeDetailsProvidingMetadataItem itdMetadata = (ItdTypeDetailsProvidingMetadataItem) metadataItem;
        final ItdTypeDetails itdTypeDetails = itdMetadata.getMemberHoldingTypeDetails();
        if (itdTypeDetails == null) {
            return;
        }
        final String localMid = formBackingObjectTypesToLocalMids.get(itdTypeDetails.getGovernor().getName());
        if (localMid != null) {
            getMetadataService().evictAndGet(localMid);
        }
        return;
    }
    if (MetadataIdentificationUtils.isIdentifyingInstance(downstreamDependency)) {
        getMetadataService().evictAndGet(downstreamDependency);
    }
}
Also used : RooJavaType(org.springframework.roo.model.RooJavaType) JpaJavaType(org.springframework.roo.model.JpaJavaType) JavaType(org.springframework.roo.model.JavaType) ItdTypeDetailsProvidingMetadataItem(org.springframework.roo.classpath.itd.ItdTypeDetailsProvidingMetadataItem) ItdTypeDetails(org.springframework.roo.classpath.details.ItdTypeDetails) LogicalPath(org.springframework.roo.project.LogicalPath) ItdTypeDetailsProvidingMetadataItem(org.springframework.roo.classpath.itd.ItdTypeDetailsProvidingMetadataItem) MetadataItem(org.springframework.roo.metadata.MetadataItem)

Example 79 with LogicalPath

use of org.springframework.roo.project.LogicalPath in project spring-roo by spring-projects.

the class ThymeleafUIConfigurationMetadataProviderImpl method getGovernorPhysicalTypeIdentifier.

@Override
protected String getGovernorPhysicalTypeIdentifier(final String metadataIdentificationString) {
    final JavaType javaType = ThymeleafUIConfigurationMetadata.getJavaType(metadataIdentificationString);
    final LogicalPath path = ThymeleafUIConfigurationMetadata.getPath(metadataIdentificationString);
    return PhysicalTypeIdentifier.createIdentifier(javaType, path);
}
Also used : JavaType(org.springframework.roo.model.JavaType) RooJavaType(org.springframework.roo.model.RooJavaType) LogicalPath(org.springframework.roo.project.LogicalPath)

Example 80 with LogicalPath

use of org.springframework.roo.project.LogicalPath in project spring-roo by spring-projects.

the class WebMvcConfigurationMetadataProviderImpl method getGovernorPhysicalTypeIdentifier.

@Override
protected String getGovernorPhysicalTypeIdentifier(final String metadataIdentificationString) {
    final JavaType javaType = WebMvcConfigurationMetadata.getJavaType(metadataIdentificationString);
    final LogicalPath path = WebMvcConfigurationMetadata.getPath(metadataIdentificationString);
    return PhysicalTypeIdentifier.createIdentifier(javaType, path);
}
Also used : JavaType(org.springframework.roo.model.JavaType) RooJavaType(org.springframework.roo.model.RooJavaType) LogicalPath(org.springframework.roo.project.LogicalPath)

Aggregations

LogicalPath (org.springframework.roo.project.LogicalPath)85 JavaType (org.springframework.roo.model.JavaType)62 RooJavaType (org.springframework.roo.model.RooJavaType)55 ClassOrInterfaceTypeDetails (org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails)13 JpaJavaType (org.springframework.roo.model.JpaJavaType)12 ClassOrInterfaceTypeDetailsBuilder (org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetailsBuilder)10 AnnotatedJavaType (org.springframework.roo.classpath.details.annotations.AnnotatedJavaType)9 AnnotationMetadataBuilder (org.springframework.roo.classpath.details.annotations.AnnotationMetadataBuilder)9 SpringJavaType (org.springframework.roo.model.SpringJavaType)9 ArrayList (java.util.ArrayList)8 InputStream (java.io.InputStream)7 AnnotationMetadata (org.springframework.roo.classpath.details.annotations.AnnotationMetadata)6 MemberDetails (org.springframework.roo.classpath.scanner.MemberDetails)5 BufferedInputStream (java.io.BufferedInputStream)4 IOException (java.io.IOException)4 OutputStream (java.io.OutputStream)4 ZipInputStream (java.util.zip.ZipInputStream)4 I18n (org.springframework.roo.addon.web.mvc.i18n.components.I18n)4 FieldMetadata (org.springframework.roo.classpath.details.FieldMetadata)3 JavaSymbolName (org.springframework.roo.model.JavaSymbolName)3