1 8 package org.jboss.axis.utils; 11 12 20 public final class CLOptionDescriptor 21 { 22 25 public static final int ARGUMENT_REQUIRED = 1 << 1; 26 29 public static final int ARGUMENT_OPTIONAL = 1 << 2; 30 33 public static final int ARGUMENT_DISALLOWED = 1 << 3; 34 37 public static final int ARGUMENTS_REQUIRED_2 = 1 << 4; 38 41 public static final int DUPLICATES_ALLOWED = 1 << 5; 42 43 private final int m_id; 44 private final int m_flags; 45 private final String m_name; 46 private final String m_description; 47 private final int[] m_incompatible; 48 49 57 public CLOptionDescriptor(final String name, 58 final int flags, 59 final int id, 60 final String description) 61 { 62 this(name, flags, id, description, 63 ((flags & CLOptionDescriptor.DUPLICATES_ALLOWED) > 0) 64 ? new int[]{} 65 : new int[]{id}); 66 } 67 68 76 public CLOptionDescriptor(final String name, 77 final int flags, 78 final int id, 79 final String description, 80 final int[] incompatable) 81 { 82 m_id = id; 83 m_name = name; 84 m_flags = flags; 85 m_description = description; 86 m_incompatible = incompatable; 87 } 88 89 92 protected final int[] getIncompatble() 93 { 94 return getIncompatible(); 95 } 96 97 protected final int[] getIncompatible() 98 { 99 return m_incompatible; 100 } 101 102 107 public final String getDescription() 108 { 109 return m_description; 110 } 111 112 118 public final int getFlags() 119 { 120 return m_flags; 121 } 122 123 129 public final int getId() 130 { 131 return m_id; 132 } 133 134 139 public final String getName() 140 { 141 return m_name; 142 } 143 144 149 public final String toString() 150 { 151 return 152 new StringBuffer () 153 .append("[OptionDescriptor ").append(m_name) 154 .append(", ").append(m_id).append(", ").append(m_flags) 155 .append(", ").append(m_description).append(" ]").toString(); 156 } 157 } 158 | Popular Tags |