1 16 package org.apache.axis.utils; 19 20 28 public final class CLOptionDescriptor 29 { 30 31 public static final int ARGUMENT_REQUIRED = 1 << 1; 32 33 public static final int ARGUMENT_OPTIONAL = 1 << 2; 34 35 public static final int ARGUMENT_DISALLOWED = 1 << 3; 36 37 public static final int ARGUMENTS_REQUIRED_2 = 1 << 4; 38 39 public static final int DUPLICATES_ALLOWED = 1 << 5; 40 41 private final int m_id; 42 private final int m_flags; 43 private final String m_name; 44 private final String m_description; 45 private final int[] m_incompatible; 46 47 55 public CLOptionDescriptor( final String name, 56 final int flags, 57 final int id, 58 final String description ) 59 { 60 this( name, flags, id, description, 61 ((flags & CLOptionDescriptor.DUPLICATES_ALLOWED) > 0) 62 ? new int[] {} 63 : new int[] { id } ); 64 } 65 66 74 public CLOptionDescriptor( final String name, 75 final int flags, 76 final int id, 77 final String description, 78 final int[] incompatable ) 79 { 80 m_id = id; 81 m_name = name; 82 m_flags = flags; 83 m_description = description; 84 m_incompatible = incompatable; 85 } 86 87 90 protected final int[] getIncompatble() 91 { 92 return getIncompatible(); 93 } 94 95 protected final int[] getIncompatible() 96 { 97 return m_incompatible; 98 } 99 100 105 public final String getDescription() 106 { 107 return m_description; 108 } 109 110 116 public final int getFlags() 117 { 118 return m_flags; 119 } 120 121 127 public final int getId() 128 { 129 return m_id; 130 } 131 132 137 public final String getName() 138 { 139 return m_name; 140 } 141 142 147 public final String toString() 148 { 149 return 150 new StringBuffer () 151 .append("[OptionDescriptor ").append(m_name) 152 .append(", ").append(m_id).append(", ").append(m_flags) 153 .append(", ").append(m_description).append(" ]").toString(); 154 } 155 } 156 | Popular Tags |