org.jboss.forge.shell.plugins.Alias类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.jboss.forge.shell.plugins.Alias类的一些代码示例,展示了Alias类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alias类的具体详情如下:
包路径:org.jboss.forge.shell.plugins.Alias
类名称:Alias

Alias介绍

暂无

代码示例

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

/**
 * @Author Paul Bakker - paul.bakker@luminis.eu
 */
@Alias("forge.spec.jms")
public class JmsFacetImpl extends BaseJavaEEFacet implements JMSFacet
{
  @Inject
  public JmsFacetImpl(DependencyInstaller installer)
  {
    super(installer);
  }

  @Override
  protected List<Dependency> getRequiredDependencies()
  {
    return Arrays.asList(
        (Dependency) DependencyBuilder.create("org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec")
    );
  }
}

代码示例来源:origin: org.jboss.forge/forge-shell-api

/**
* Return the name of the given bean type.
*/
public static String getName(final Class<?> type)
{
 String result = type.getSimpleName();
 if (Annotations.isAnnotationPresent(type, Alias.class))
 {
   Alias annotation = Annotations.getAnnotation(type, Alias.class);
   if ((annotation.value() != null) && !annotation.value().trim().isEmpty())
   {
    result = annotation.value();
   }
 }
 return result;
}

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@Alias("forge.spec.jta")
public class JTAFacetImpl extends BaseJavaEEFacet implements JTAFacet
{
  @Inject
  public JTAFacetImpl(final DependencyInstaller installer)
  {
   super(installer);
  }

  @Override
  protected List<Dependency> getRequiredDependencies()
  {
   return Arrays.asList(
        (Dependency)DependencyBuilder.create("org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec")
        );
  }
}

代码示例来源:origin: org.jboss.forge/forge-shell

private String getPluginName(final Class<?> plugin)
  {
   String name = null;

   if (Annotations.isAnnotationPresent(plugin, Alias.class))
   {
     Alias named = Annotations.getAnnotation(plugin, Alias.class);
     if (named != null)
     {
      name = named.value();
     }
   }

   if ((name == null) || "".equals(name.trim()))
   {
     name = plugin.getSimpleName();
   }
   return name.toLowerCase();
  }
}

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@Alias("forge.spec.ejb")
public class EJBFacetImpl extends BaseJavaEEFacet implements EJBFacet
{
  @Inject
  public EJBFacetImpl(final DependencyInstaller installer)
  {
   super(installer);
  }

  @Override
  protected List<Dependency> getRequiredDependencies()
  {
   return Arrays.asList(
        (Dependency) DependencyBuilder.create("org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec")
        );
  }
}

代码示例来源:origin: org.jboss.forge/forge-shell

@Inject
public LessPlugin(@Alias("more") MorePlugin morePlugin)
{
 this.morePlugin = morePlugin;
}

代码示例来源:origin: org.jboss.forge/forge-shell-api

@Alias("forge.configuration.facet")
public class ConfigurationFacet extends BaseFacet

代码示例来源:origin: org.jboss.forge/forge-shell

@Alias("about")
@Topic("Shell Environment")
@Help("Display information about this forge.")
public class AboutPlugin implements Plugin
{
  @Inject
  @Alias("forge")
  private ForgePlugin forge;

  @DefaultCommand
  public void run(PipeOut out)
  {
   forge.about(out);
  }
}

代码示例来源:origin: org.jboss.forge/forge-dev-plugins

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 * @author Mike Brock .
 */
@Alias("git")
@Topic("Version Control")
public class GitShellPlugin implements Plugin
{
  private final Shell shell;

  @Inject
  public GitShellPlugin(final Shell shell)
  {
   this.shell = shell;
  }

  @DefaultCommand
  public void run(final PipeOut out, final String... parms) throws IOException
  {
   NativeSystemCall.execFromPath("git", parms, out, shell.getCurrentDirectory());
  }

}

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@Alias("forge.spec.jstl")
@RequiresFacet(ServletFacet.class)
public class JSTLFacetImpl extends BaseJavaEEFacet implements JSTLFacet
{
  @Inject
  public JSTLFacetImpl(final DependencyInstaller installer)
  {
   super(installer);
  }

  @Override
  protected List<Dependency> getRequiredDependencies()
  {
   return Arrays
        .asList((Dependency) DependencyBuilder
            .create("org.jboss.spec.javax.servlet.jstl:jboss-jstl-api_1.2_spec"));
  }

}

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@Alias("forge.spec.jaxws")
@RequiresFacet(ServletFacet.class)
public class SoapFacetImpl extends BaseJavaEEFacet implements SoapFacet
{
  @Inject
  public SoapFacetImpl(final DependencyInstaller installer)
  {
   super(installer);
  }

  @Override
  protected List<Dependency> getRequiredDependencies()
  {
   return Arrays.asList(
        (Dependency) DependencyBuilder.create("org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec"),
        (Dependency) DependencyBuilder.create("org.jboss.spec.javax.xml.rpc:jboss-jaxrpc-api_1.1_spec"),
        (Dependency) DependencyBuilder.create("org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec"),
        (Dependency) DependencyBuilder.create("org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec")
        );
  }
}

代码示例来源:origin: org.jboss.forge/forge-shell

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 * 
 */
@Help("Un-alias an aliased command. See also 'help alias'")
@Alias("unalias")
public class UnaliasPlugin implements Plugin
{
  @Inject
  private AliasRegistry registry;

  @DefaultCommand
  public void set(final PipeOut out,
      @Option(help = "The alias name to remove: E.g: 'mycommand'") final String[] aliases)
  {
   if ((aliases != null) && (aliases.length > 0))
   {
     for (String alias : aliases)
     {
      registry.removeAlias(alias);
     }
   }
  }
}

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

@Alias("forge.spec.jaxrs.webxml")
public class RestWebXmlFacetImpl extends BaseFacet implements RestWebXmlFacet

代码示例来源:origin: org.jboss.forge/forge-shell

/**
 * An aliasing wrapper for {@link MorePlugin}
 * 
 * @author Mike Brock .
 */
@Alias("less")
@Topic("Shell Environment")
public class LessPlugin implements Plugin
{
  private final MorePlugin morePlugin;

  @Inject
  public LessPlugin(@Alias("more") MorePlugin morePlugin)
  {
   this.morePlugin = morePlugin;
  }

  @DefaultCommand
  public void run(@PipeIn InputStream pipeIn,
      final Resource<?> file,
      final PipeOut pipeOut)
      throws IOException

  {
   morePlugin.run(pipeIn, file, true, pipeOut);
  }
}

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@Alias("jstl")
@RequiresProject
public class JSTLPlugin implements Plugin
{
  @Inject
  private Project project;

  @Inject
  private Event<InstallFacets> request;

  @SetupCommand
  public void setup(final PipeOut out)
  {
   if (!project.hasFacet(JSTLFacet.class))
   {
     request.fire(new InstallFacets(JSTLFacet.class));
   }

   if (project.hasFacet(JSTLFacet.class))
   {
     ShellMessages.success(out, "Java Standard Template Library (JSTL) is installed.");
   }
  }

}

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@Alias("soap")
@RequiresProject
public class SoapPlugin implements Plugin
{
  @Inject
  private Project project;

  @Inject
  private Event<InstallFacets> request;

  @SetupCommand
  public void setup(final PipeOut out)
  {
   if (!project.hasFacet(SoapFacet.class))
   {
     request.fire(new InstallFacets(SoapFacet.class));
   }

   if (project.hasFacet(SoapFacet.class))
   {
     ShellMessages.success(out, "Soap Web Services (JAX-WS) is installed.");
   }
  }

}

代码示例来源:origin: org.jboss.forge/forge-javaee-impl

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@Alias("jta")
@RequiresProject
public class JTAPlugin implements Plugin
{
  @Inject
  private Project project;

  @Inject
  private Event<InstallFacets> request;

  @SetupCommand
  public void setup(final PipeOut out)
  {
   if (!project.hasFacet(JTAFacet.class))
   {
     request.fire(new InstallFacets(JTAFacet.class));
   }

   if (project.hasFacet(JTAFacet.class))
   {
     ShellMessages.success(out, "Java Transaction API (JTA) is installed.");
   }
  }

}

代码示例来源:origin: org.jboss.forge/forge-shell

@Alias("run")
@Topic("Shell Environment")
public class RunPlugin implements Plugin

代码示例来源:origin: org.jboss.forge/forge-shell

/**
 * @author <a href="mailto:rdruss@gmail.com">Rodney Russ</a>
 */
@Alias("pwr")
@Topic("File & Resources")
@Help("Prints the current working resource.")
public class PwrPlugin implements org.jboss.forge.shell.plugins.Plugin
{

  @Inject
  private Shell shell;

  @DefaultCommand
  public void run()
  {
   shell.println(shell.getCurrentResource().getFullyQualifiedName());
  }
}

代码示例来源:origin: org.jboss.forge/forge-shell

/**
 * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
 */
@Alias("clear")
@Topic("Shell Environment")
@Help("Clears the console output.")
public class ClearPlugin implements Plugin
{
  @Inject
  Shell shell;

  @DefaultCommand
  public void run()
  {
   shell.clear();
  }
}

相关文章