Package org.nasutekds.server.admin

Examples of org.nasutekds.server.admin.PropertyDefinitionUsageBuilder$MyPropertyDefinitionVisitor


      return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_BLANK.get();
    } else if (namingPropertyDefinition != null) {
      try {
        namingPropertyDefinition.decodeValue(illegalName);
      } catch (IllegalPropertyValueStringException e) {
        PropertyDefinitionUsageBuilder builder =
          new PropertyDefinitionUsageBuilder(true);
        return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_SYNTAX.get(
            illegalName, namingPropertyDefinition.getName(), builder
                .getUsage(namingPropertyDefinition));
      }
    }

    return ERR_ILLEGAL_MANAGED_OBJECT_NAME_EXCEPTION_OTHER.get(illegalName);
View Full Code Here



  // Display a property's syntax.
  private static <T> void displayPropertySyntax(ConsoleApplication app,
      PropertyDefinition<T> d) throws IllegalArgumentException {
    PropertyDefinitionUsageBuilder b = new PropertyDefinitionUsageBuilder(true);

    TableBuilder builder = new TableBuilder();
    builder.startRow();
    builder.appendCell(INFO_EDITOR_HEADING_SYNTAX.get());
    builder.appendCell(b.getUsage(d));

    TextTablePrinter printer = new TextTablePrinter(app.getErrorStream());
    printer.setDisplayHeadings(false);
    printer.setIndentWidth(4);
    printer.setColumnWidth(1, 0);
View Full Code Here

      // Display the options.
      builder.appendCell(getPropertyOptionSummary(pd));

      // Display the syntax.
      PropertyDefinitionUsageBuilder v = new PropertyDefinitionUsageBuilder(
          false);
      builder.appendCell(v.getUsage(pd));
    }

    TablePrinter printer = new TextTablePrinter(app.getErrorStream());
    builder.print(printer);
  }
View Full Code Here

          // Display the options.
          builder.appendCell(getPropertyOptionSummary(pd));

          // Display the syntax.
          PropertyDefinitionUsageBuilder v = new PropertyDefinitionUsageBuilder(
              false);
          builder.appendCell(v.getUsage(pd));
        }
      }
    }

    TablePrinter printer;
View Full Code Here

          // have a different usage.
          PropertyDefinition<?> pd = r.getNamingPropertyDefinition();

          if (pd != null) {
            // Use syntax and description from naming property.
            PropertyDefinitionUsageBuilder b =
              new PropertyDefinitionUsageBuilder(false);
            Message usage = Message.raw("{" + b.getUsage(pd) + "}");
            arg = new StringArgument(argName, null, argName, false, true,
                usage, INFO_DSCFG_DESCRIPTION_NAME_CREATE_EXT.get(d
                    .getUserFriendlyName(), pd.getName(), pd.getSynopsis()));
          } else {
            arg = new StringArgument(argName, null, argName, false, true,
View Full Code Here

      if (pd.getDescription() != null) {
        app.println();
        app.println(pd.getDescription(), 4);
      }

      PropertyDefinitionUsageBuilder b =
        new PropertyDefinitionUsageBuilder(true);
      TableBuilder builder = new TableBuilder();
      builder.startRow();
      builder.appendCell(INFO_EDITOR_HEADING_SYNTAX.get());
      builder.appendCell(b.getUsage(pd));

      TextTablePrinter printer = new TextTablePrinter(app.getErrorStream());
      printer.setDisplayHeadings(false);
      printer.setIndentWidth(4);
      printer.setColumnWidth(1, 0);
View Full Code Here

      /**
       * {@inheritDoc}
       */
      @Override
      public Void visitString(StringPropertyDefinition d, PrintStream p) {
        PropertyDefinitionUsageBuilder usageBuilder =
          new PropertyDefinitionUsageBuilder(false);

        TableBuilder builder = new TableBuilder();
        builder.startRow();
        builder.appendCell(INFO_DSCFG_HELP_HEADING_SYNTAX.get());
        builder.appendCell(HEADING_SEPARATOR);
        builder.appendCell(usageBuilder.getUsage(d));

        if (d.getPattern() != null) {
          builder.startRow();
          builder.startRow();
          builder.appendCell();
View Full Code Here

       * {@inheritDoc}
       */
      @Override
      public <T> Void visitUnknown(PropertyDefinition<T> d, PrintStream p)
          throws UnknownPropertyDefinitionException {
        PropertyDefinitionUsageBuilder usageBuilder =
          new PropertyDefinitionUsageBuilder(true);
        displayUsage(p, usageBuilder.getUsage(d));

        return null;
      }
View Full Code Here

      return new CLIException(message);
    } else if (pd != null) {
      try {
        pd.decodeValue(illegalName);
      } catch (IllegalPropertyValueStringException e1) {
        PropertyDefinitionUsageBuilder b = new PropertyDefinitionUsageBuilder(
            true);
        Message syntax = b.getUsage(pd);

        Message message = ERR_DSCFG_ERROR_ILLEGAL_NAME_SYNTAX.get(
            illegalName, d.getUserFriendlyName(), syntax);
        return new CLIException(message);
      }
View Full Code Here

    TableBuilder builder = new TableBuilder();
    builder.addSortKey(0);
    builder.appendHeading(INFO_DSCFG_HEADING_PROPERTY_NAME.get());
    builder.appendHeading(INFO_DSCFG_HEADING_PROPERTY_SYNTAX.get());

    PropertyDefinitionUsageBuilder b = new PropertyDefinitionUsageBuilder(true);
    for (PropertyIsMandatoryException pe : e.getCauses()) {
      PropertyDefinition<?> pd = pe.getPropertyDefinition();
      builder.startRow();
      builder.appendCell(pd.getName());
      builder.appendCell(b.getUsage(pd));
    }

    TextTablePrinter printer = new TextTablePrinter(app.getErrorStream());
    printer.setDisplayHeadings(true);
    printer.setColumnWidth(1, 0);
View Full Code Here

TOP

Related Classes of org.nasutekds.server.admin.PropertyDefinitionUsageBuilder$MyPropertyDefinitionVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.