Tabnine Logo
CommandModel$ParamModel.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
org.glassfish.api.admin.CommandModel$ParamModel

Best Java code snippets using org.glassfish.api.admin.CommandModel$ParamModel.getName (Showing top 20 results out of 315)

origin: org.glassfish.main.admin/admin-cli

private void appendEchoOption(StringBuilder sb, ParamModel opt, String value) {
  sb.append("--").append(lc(opt.getName()));
  if (opt.getType() == Boolean.class ||
    opt.getType() == boolean.class) {
    sb.append("=").append(Boolean.toString(Boolean.parseBoolean(value))); 
  } else {    // STRING or FILE
    sb.append(" ").append(quote(value));
  }
  sb.append(' ');
}
origin: org.glassfish.main.common/common-util

@Override
public void add(ParamModel model) {
  if (!params.containsKey(model.getName())) {
    params.put(model.getName(), model);
  }
}
origin: org.glassfish.main.common/common-util

@Override
public void add(ParamModel model) {
  if (!params.containsKey(model.getName())) {
    params.put(model.getName(), model);
  }
}
origin: org.glassfish.main.admin/config-api

@Override
public void postConstruct() {
  super.postConstruct();
  listing = targetMethod.getAnnotation(Listing.class);
  resolverType = listing.resolver();
  try {
  // we pass false for "useAnnotations" as the @Param declarations on
  // the target type are not used for the List method parameters.
    cmdModel = new GenericCommandModel(targetType, false, null, listing.i18n(),
        new LocalStringManagerImpl(targetType),
        habitat.<DomDocument>getService(DomDocument.class), commandName, 
        false, listing.resolver(), GenericListCommand.class);
    targetModel = habitat.<DomDocument>getService(DomDocument.class).buildModel(targetType);
    if (logger.isLoggable(level)) {
      for (String paramName : cmdModel.getParametersNames()) {
        CommandModel.ParamModel param = cmdModel.getModelFor(paramName);
        logger.log(Level.FINE, "I take {0} parameters", param.getName());
      }
    }
  } catch(Exception e) {
    String msg = localStrings.getLocalString(GenericCrudCommand.class,
        "GenericCreateCommand.command_model_exception",
        "Exception while creating the command model for the generic command {0} : {1}",
        commandName, e.getMessage());
    LogHelper.log(logger, Level.SEVERE,ConfigApiLoggerInfo.GENERIC_CREATE_CMD_FAILED, e, commandName);
    throw new RuntimeException(msg, e);
  }      
}
origin: org.glassfish.main.admin/config-api

@Override
public void postConstruct() {
  super.postConstruct();
  create = getAnnotation(targetMethod, Create.class);
  resolverType = create.resolver();
  try {
    model = new GenericCommandModel(targetType, true, create.cluster(), create.i18n(),
        new LocalStringManagerImpl(targetType),
        habitat.<DomDocument>getService(DomDocument.class),
        commandName, AnnotationUtil.presentTransitive(ManagedJob.class, create.decorator()), create.resolver(), create.decorator());
    if (logger.isLoggable(level)) {
      for (String paramName : model.getParametersNames()) {
        CommandModel.ParamModel param = model.getModelFor(paramName);
        logger.log(Level.FINE, "I take {0} parameters", param.getName());
      }
    }
  } catch(Exception e) {
    String msg = localStrings.getLocalString(GenericCrudCommand.class,
        "GenericCreateCommand.command_model_exception",
        "Exception while creating the command model for the generic command {0} : {1}",
        commandName, e.getMessage());
    logger.log(Level.SEVERE, ConfigApiLoggerInfo.GENERIC_CREATE_CMD_FAILED, commandName);
    throw new RuntimeException(msg, e);
  }
  
}
origin: org.glassfish.admin/admin-cli

/**
 * Get ParamModel for long option name.
 */
private ParamModel lookupLongOption(String s) {
if (s == null || s.length() == 0)
  return null;
  // XXX - for now, fake it if no options
  if (options == null) {
    // no valid options specified so everything is valid
    return new ParamModelData(s, String.class, true, null);
  }
  for (ParamModel od : options) {
    if (od.getParam().primary())
  continue;
    if (s.equalsIgnoreCase(od.getName()))
      return od;
  if (s.equalsIgnoreCase(od.getParam().alias()))
      return od;
  }
  return null;
}
origin: org.glassfish.admin/config-api

public void postConstruct() {
  super.postConstruct();
  create = getAnnotation(targetMethod, Create.class);
  resolverType = create.resolver();
  try {
    model = new GenericCommandModel(targetType, true, create.cluster(), create.i18n(),
        new LocalStringManagerImpl(targetType),
        habitat.getComponent(DomDocument.class),
        commandName, create.resolver(), create.decorator());
    if (logger.isLoggable(level)) {
      for (String paramName : model.getParametersNames()) {
        CommandModel.ParamModel param = model.getModelFor(paramName);
        logger.fine("I take " + param.getName() + " parameters");
      }
    }
  } catch(Exception e) {
    String msg = localStrings.getLocalString(GenericCrudCommand.class,
        "GenericCreateCommand.command_model_exception",
        "Exception while creating the command model for the generic command {0} : {1}",
        commandName, e.getMessage());
    logger.severe(msg);
    throw new ComponentException(msg, e);
  }
}
origin: org.glassfish.admin/cli-optional

/**
 * Add --adminport and --instanceport options with
 * proper default values.  (Can't set default values above
 * because it conflicts with --portbase option processing.)
 */
protected Collection<ParamModel> usageOptions() {
  Collection<ParamModel> opts = commandModel.getParameters();
  Set<ParamModel> uopts = new LinkedHashSet<ParamModel>();
ParamModel aPort = new ParamModelData(ADMIN_PORT, String.class, true, 
    Integer.toString(CLIConstants.DEFAULT_ADMIN_PORT));
ParamModel iPort = new ParamModelData(INSTANCE_PORT, String.class, true,
    Integer.toString(DEFAULT_INSTANCE_PORT));
for (ParamModel pm : opts) {
  if (pm.getName().equals(ADMIN_PORT))
      uopts.add(aPort);
  else if (pm.getName().equals(INSTANCE_PORT))
      uopts.add(iPort);
    else
      uopts.add(pm);
}
  return uopts;
}
origin: org.glassfish.main.admin/admin-cli

/**
 * Get ParamModel for long option name.
 */
private ParamModel lookupLongOption(String s) {
if (s == null || s.length() == 0)
  return null;
  // XXX - for now, fake it if no options
  if (options == null) {
    // no valid options specified so everything is valid
    return new ParamModelData(s, String.class, true, null);
  }
  for (ParamModel od : options) {
    if (od.getParam().primary())
  continue;
    if (s.equalsIgnoreCase(od.getName()))
      return od;
  if (s.equalsIgnoreCase(od.getParam().alias()))
      return od;
  }
  return null;
}
origin: org.glassfish.admin/admin-cli

/**
 * In the usage message modify the --printprompt option to have a
 * default based on the --interactive option.
 */
protected Collection<ParamModel> usageOptions() {
  Collection<ParamModel> opts = commandModel.getParameters();
  Set<ParamModel> uopts = new LinkedHashSet<ParamModel>();
ParamModel p = new CommandModelData.ParamModelData("printprompt",
  boolean.class, true, Boolean.toString(programOpts.isInteractive()));
for (ParamModel pm : opts) {
  if (pm.getName().equals("printprompt"))
      uopts.add(p);
    else
      uopts.add(pm);
}
  return uopts;
}
origin: org.glassfish.main.admin/admin-cli

/**
 * In the usage message modify the --printprompt option to have a default
 * based on the --interactive option.
 */
protected Collection<ParamModel> usageOptions() {
  Collection<ParamModel> opts = commandModel.getParameters();
  Set<ParamModel> uopts = new LinkedHashSet<ParamModel>();
  ParamModel p = new CommandModelData.ParamModelData("printprompt",
      boolean.class, true, Boolean.toString(programOpts.isInteractive()));
  for (ParamModel pm : opts) {
    if (pm.getName().equals("printprompt"))
      uopts.add(p);
    else
      uopts.add(pm);
  }
  return uopts;
}
origin: org.glassfish.main.admin/admin-cli

private String passwordName(ParamModel opt) {
  return Environment.getPrefix() + opt.getName().toUpperCase(Locale.ENGLISH);
}
origin: eclipse-ee4j/glassfish

@Override
public void add(ParamModel model) {
  if (!params.containsKey(model.getName())) {
    params.put(model.getName(), model);
  }
}
origin: eclipse-ee4j/glassfish

@Override
public void add(ParamModel model) {
  if (!params.containsKey(model.getName())) {
    params.put(model.getName(), model);
  }
}
origin: org.glassfish.admin/admin-util

/**
 * Add the ParamModel to this CommandModel.
 */
public void add(ParamModel model) {
  if (!params.containsKey(model.getName())) {
    params.put(model.getName(), model);
  }
}
origin: org.glassfish.main.admin/admin-util

/**
 * Add the ParamModel to this CommandModel.
 */
public void add(ParamModel model) {
  if (!params.containsKey(model.getName())) {
    params.put(model.getName(), model);
  }
}
origin: org.glassfish.main.admin/admin-util

  @Override
  public int compare(ParamModel o1, ParamModel o2) {
    return o1.getName().compareTo(o2.getName());
  }
});
origin: eclipse-ee4j/glassfish

public boolean isParamId(String key) {
  if (getParam().primary()) {
    return "DEFAULT".equals(key) || getName().equalsIgnoreCase(key);
  }
  
  return getName().equalsIgnoreCase(key) ||
  getParam().shortName().equals(key) ||
  getParam().alias().equalsIgnoreCase(key);
}
origin: org.glassfish.main.common/glassfish-api

public boolean isParamId(String key) {
  if (getParam().primary()) {
    return "DEFAULT".equals(key) || getName().equalsIgnoreCase(key);
  }
  
  return getName().equalsIgnoreCase(key) ||
  getParam().shortName().equals(key) ||
  getParam().alias().equalsIgnoreCase(key);
}
origin: org.glassfish.admin/cli-optional

public void validatePassword(String password, ParamModel pwdOpt)
    throws CommandValidationException {
  // XXX - hack alert!  the description is stored in the default value
  String description = pwdOpt.getParam().defaultValue();
  if (!ok(description))
    description = pwdOpt.getName();
  if (password == null)
    throw new CommandValidationException(
              strings.get("PasswordMissing", description));
}
org.glassfish.api.adminCommandModel$ParamModelgetName

Javadoc

Returns the command parameter name.

Popular methods of CommandModel$ParamModel

  • getParam
    Returns the command @Param annotation values.
  • getType
    Returns the parameter type.
  • isParamId
  • getLocalizedDescription
    Returns a localized description for this parameter

Popular in Java

  • Making http requests using okhttp
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now