Project
IntelliJ IDEA
Priority
Normal
Type
Feature
Fix versions
No Fix versions
State
Fixed
Assignee
Peter Gromov
Subsystem
J2EE.Spring
Affected versions
No Affected versions
Fixed in build
108.65  
  • Created by   Taras Tielkes
    4 years ago (27 Aug 2007 20:36)
  • Updated by   root
    2 years ago (17 Jan 2010 20:51)
  • Jira: IDEADEV-20604
    (history, comments)
 
IDEA-40613 spring + namespaces: use schema metadata annotations
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
At the moment, there's no completion or resolving for element/attribute values from namespaces that the spring facet does not know about. (_custom namespaces or namespace from spring 2.1_)

Some could be provided, based on schema annotations.

See spring-tool-2.0.xsd for the definitions of the annotations. For usage examples, see the regular spring namespace schemas, and the examples below:
Note that:
  • XML editor already has code to extract annotations from schema (used for Ctrl-Q). Perhaps it could be reused?
  • annotation kind="ref" seems to imply a bean reference, annotation kind="direct" (the default) seems to imply a literal value

----
  • Attribute contains a _bean name_, the type of the referenced bean should be assignable to the specified type
  • Provide bean name completion, filter suggestions by specified type
<xsd:attribute name="transaction-manager" type="xsd:string">          
  <xsd:annotation>                                                                                  
    <xsd:appinfo>                                                                                    
      <tool:annotation kind="ref">                                                                    
        <tool:expected-type type="org.springframework.transaction.PlatformTransactionManager"/>        
      </tool:annotation>                                                                              
    </xsd:appinfo>                                                                                   
  </xsd:annotation>                                                                                 
</xsd:attribute>

----
  • Attribute is a resource path
  • Treat is similar to a property of type org.springframework.core.io.Resource
<xsd:attribute name="location" type="xsd:string">                        
  <xsd:annotation>                                                        
    <xsd:appinfo>                                                          
      <tool:annotation>                                                     
        <tool:expected-type type="org.springframework.core.io.Resource"/>    
      </tool:annotation>                                                    
    </xsd:appinfo>                                                         
  </xsd:annotation>                                                       
</xsd:attribute>

----
  • Attribute is a FQN class name (similar to a property of type java.lang.Class)
  • In addition, the class type should be assignable to type specified y the "assignable-to" element (perhaps this could be done by an inspection?)
<xsd:attribute name="list-class" type="xsd:string"> 
  <xsd:annotation>                                   
    <xsd:appinfo>                                     
      <tool:annotation>                                
        <tool:expected-type type="java.lang.Class"/>    
        <tool:assignable-to type="java.util.List"/>     
      </tool:annotation>                               
    </xsd:appinfo>                                    
  </xsd:annotation>                                  
</xsd:attribute>



Issue was resolved
Comments (0)
 
History
 
Linked Issues (?)
 
Issue has no comments