⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classpathvarnamingstrategy.exsd

📁 实用的eclipse插件 classlocator 经常在开发过程
💻 EXSD
字号:
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="com.danikenan.eclipse.classlocator">
<annotation>
   <appInfo>
      <meta.schema plugin="com.danikenan.eclipse.classlocator" id="classpathVarNamingStrategy" name="Classpath Variable Naming Strategy"/>
   </appInfo>
   <documentation>
      A naming strategy used when creating new classpath variables. This extension enables developers to control the naming of classpath variables created by the plugin and impose thir own naming conventions or any other rational behind the generated names.
   </documentation>
</annotation>

   <element name="extension">
      <complexType>
         <sequence>
            <element ref="classpathVarNamingStrategy"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="classpathVarNamingStrategy">
      <annotation>
         <documentation>
            A naming strategy used when creating new classpath variables.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  a fully qualified name of the Java class that implements &lt;samp&gt;com.danikenan.eclipse.classlocator.ClasspathVarNamingStrategy&lt;/samp&gt; interface
               </documentation>
               <appInfo>
                  <meta.attribute kind="java"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appInfo>
         <meta.section type="since"/>
      </appInfo>
      <documentation>
         Version 1.0.2
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="examples"/>
      </appInfo>
      <documentation>
         &lt;pre&gt;&lt;extension id="myID" name="myPoint"    point="com.danikenan.eclipse.classlocator.classpathVarNamingStrategy"&gt;            &lt;classpathVarNamingStrategy  class="myPackage.MyStrategy"/&gt;      &lt;/extension&gt;&lt;/pre&gt;
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="apiInfo"/>
      </appInfo>
      <documentation>
         The strategy must implement&lt;code&gt;com.danikenan.eclipse.classlocator.ClasspathVarNamingStrategy&lt;/code&gt;which defines a single method:&lt;pre&gt;    /**     * Suggest a name for classpath variable corresponding to the path given.     * Keep in mind that if a name is rejected, you need to change it, otherwise there is     * a possibility for an endless loop.     *      * @param path the path for the classpath var.     * @param rejectedName a previously rejected name, if such exists or null, if first     * time for path.     * @return String the suggested name.     */    public String suggestName(IPath path, String rejectedName);&lt;/pre&gt;For each path, a new strategy instance is created. It is called with the path and a null rejectedName.If the name returned by a call is rejected (the var name exists, for example) then the strategy is called again, with the rejected name provided to it, in addition to the path.A sample implementation could look like:&lt;pre&gt;public class MyStrategy implements ClasspathVarNamingStrategy {    int    varVersion  = 0;    String baseVarName = null;    public String suggestName(IPath path, String rejectedName){      String varName;      if(rejectedName == null){        baseVarName   = "MYCOMPANY_" + path.lastSegment().replace('.', '_').toUpperCase();        varName       = baseVarName;      }      else{        varName = baseVarName + (++varVersion);      }      return varName;    }  } &lt;/pre&gt;
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="implementation"/>
      </appInfo>
      <documentation>
         The default naming generation strategy is an inner class that reads:

&lt;pre&gt;

  public static class DefaultClasspathVarNamingStrategy
      implements ClasspathVarNamingStrategy{

    int    varVersion  = 0;
    String baseVarName = null;

    public String suggestName(IPath path, String rejectedName){

      String varName;

      if(rejectedName == null){
        baseVarName   = path.lastSegment().replace('.', '_').toUpperCase();
        varName       = baseVarName;
      }
      else{
        varName = baseVarName + (++varVersion);
      }

      return varName;
    }
  }

&lt;/pre&gt;
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="copyright"/>
      </appInfo>
      <documentation>
         Copyright (C) 2002 Dani Kenan.
      </documentation>
   </annotation>

</schema>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -