| | |
| | | private static class DefaultVisitor<T> implements |
| | | DefaultBehaviorProviderVisitor<T, LocalizableMessage, PropertyDefinition<T>> { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LocalizableMessage visitAbsoluteInherited( |
| | | AbsoluteInheritedDefaultBehaviorProvider<T> d, |
| | | PropertyDefinition<T> p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LocalizableMessage visitAlias(AliasDefaultBehaviorProvider<T> d, |
| | | PropertyDefinition<T> p) { |
| | | return d.getSynopsis(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LocalizableMessage visitDefined(DefinedDefaultBehaviorProvider<T> d, |
| | | PropertyDefinition<T> p) { |
| | | LocalizableMessageBuilder builder = new LocalizableMessageBuilder(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LocalizableMessage visitRelativeInherited( |
| | | RelativeInheritedDefaultBehaviorProvider<T> d, |
| | | PropertyDefinition<T> p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LocalizableMessage visitUndefined(UndefinedDefaultBehaviorProvider<T> d, |
| | | PropertyDefinition<T> p) { |
| | | return INFO_DSCFG_HELP_FIELD_UNDEFINED.get(); |
| | |
| | | private static class Visitor extends |
| | | PropertyDefinitionVisitor<Void, PrintStream> { |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private Visitor() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <E extends Enum<E>> Void visitEnum(EnumPropertyDefinition<E> d, |
| | | PrintStream p) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Void visitString(StringPropertyDefinition d, PrintStream p) { |
| | | PropertyDefinitionUsageBuilder usageBuilder = |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public <T> Void visitUnknown(PropertyDefinition<T> d, PrintStream p) |
| | | throws PropertyException { |
| | |
| | | |
| | | |
| | | |
| | | // Common usage. |
| | | /** Common usage. */ |
| | | private void displayUsage(PrintStream p, LocalizableMessage usage) { |
| | | TableBuilder builder = new TableBuilder(); |
| | | builder.startRow(); |
| | |
| | | } |
| | | } |
| | | |
| | | // The private implementation. |
| | | /** The private implementation. */ |
| | | private final Visitor pimpl; |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // Strings used in property help. |
| | | private final static String HEADING_SEPARATOR = " : "; |
| | | /** Strings used in property help. */ |
| | | private static final String HEADING_SEPARATOR = " : "; |
| | | |
| | | // Width of biggest heading (need to be careful of I18N). |
| | | private final static int HEADING_WIDTH; |
| | | /** Width of biggest heading (need to be careful of I18N). */ |
| | | private static final int HEADING_WIDTH; |
| | | |
| | | /** |
| | | * The value for the long option category. |
| | |
| | | |
| | | |
| | | |
| | | // Displays the property option summary key. |
| | | /** Displays the property option summary key. */ |
| | | private static void displayPropertyOptionKey(ConsoleApplication app) { |
| | | LocalizableMessageBuilder builder; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Compute the options field. |
| | | /** Compute the options field. */ |
| | | private static String getPropertyOptionSummary(PropertyDefinition<?> pd) { |
| | | StringBuilder b = new StringBuilder(); |
| | | |
| | |
| | | return b.toString(); |
| | | } |
| | | |
| | | // The argument which should be used to specify the category of |
| | | // managed object to be retrieved. |
| | | /** |
| | | * The argument which should be used to specify the category of managed object |
| | | * to be retrieved. |
| | | */ |
| | | private final StringArgument categoryArgument; |
| | | |
| | | // A table listing all the available types of managed object indexed |
| | | // on their parent type. |
| | | /** |
| | | * A table listing all the available types of managed object indexed on their |
| | | * parent type. |
| | | */ |
| | | private final Map<String, Map<String, |
| | | AbstractManagedObjectDefinition<?, ?>>> categoryMap; |
| | | |
| | | // The argument which should be used to display inherited |
| | | // properties. |
| | | /** |
| | | * The argument which should be used to display inherited properties. |
| | | */ |
| | | private BooleanArgument inheritedModeArgument; |
| | | |
| | | // The sub-command associated with this handler. |
| | | /** The sub-command associated with this handler. */ |
| | | private final SubCommand subCommand; |
| | | |
| | | // A table listing all the available types of managed object indexed |
| | | // on their tag(s). |
| | | /** |
| | | * A table listing all the available types of managed object indexed on their |
| | | * tag(s). |
| | | */ |
| | | private final Map<Tag, Map<String, |
| | | AbstractManagedObjectDefinition<?, ?>>> tagMap; |
| | | |
| | | // The argument which should be used to specify the sub-type of |
| | | // managed object to be retrieved. |
| | | /** |
| | | * The argument which should be used to specify the sub-type of managed object |
| | | * to be retrieved. |
| | | */ |
| | | private final StringArgument typeArgument; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private HelpSubCommandHandler(SubCommandArgumentParser parser) |
| | | throws ArgumentException { |
| | | // Create the sub-command. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SubCommand getSubCommand() { |
| | | return subCommand; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public MenuResult<Integer> run(ConsoleApplication app, |
| | | ManagementContextFactory factory) throws ArgumentException, |
| | |
| | | return MenuResult.success(0); |
| | | } |
| | | |
| | | // Output property summary table. |
| | | /** Output property summary table. */ |
| | | private void displayNonVerbose(ConsoleApplication app, String categoryName, |
| | | String typeName, Tag tag, Set<String> propertyNames) { |
| | | if (!app.isScriptFriendly()) { |
| | |
| | | |
| | | |
| | | |
| | | // Display detailed help on managed objects and their properties. |
| | | /** Display detailed help on managed objects and their properties. */ |
| | | private void displayVerbose(ConsoleApplication app, String categoryName, |
| | | String typeName, Tag tag, Set<String> propertyNames) { |
| | | // Construct line used to separate consecutive sections. |