Ejemplo n.º 1
0
 private Set<Long> parseMechanisms(String keyword) throws IOException {
   checkDup(keyword);
   Set<Long> mechs = new HashSet<Long>();
   parseEquals();
   parseOpenBraces();
   while (true) {
     int token = nextToken();
     if (isCloseBraces(token)) {
       break;
     }
     if (token == TT_EOL) {
       continue;
     }
     if (token != TT_WORD) {
       throw excToken("Expected mechanism, read");
     }
     long mech = parseMechanism(st.sval);
     mechs.add(Long.valueOf(mech));
   }
   if (DEBUG) {
     System.out.print("mechanisms: [");
     for (Long mech : mechs) {
       System.out.print(Functions.getMechanismName(mech));
       System.out.print(", ");
     }
     System.out.println("]");
   }
   return mechs;
 }
Ejemplo n.º 2
0
 private long parseObjectClass() throws IOException {
   String name = parseWord();
   try {
     return Functions.getObjectClassId(name);
   } catch (IllegalArgumentException e) {
     throw excLine("Unknown object class " + name);
   }
 }
Ejemplo n.º 3
0
 private long decodeAttributeName(String name) throws IOException {
   if (isNumber(name)) {
     return decodeNumber(name);
   } else {
     try {
       return Functions.getAttributeId(name);
     } catch (IllegalArgumentException e) {
       throw excLine("Unknown attribute name " + name);
     }
   }
 }
Ejemplo n.º 4
0
 private long parseMechanism(String mech) throws IOException {
   if (isNumber(mech)) {
     return decodeNumber(mech);
   } else {
     try {
       return Functions.getMechanismId(mech);
     } catch (IllegalArgumentException e) {
       throw excLine("Unknown mechanism: " + mech);
     }
   }
 }
Ejemplo n.º 5
0
 private long parseKeyAlgorithm() throws IOException {
   String name = parseWord();
   if (isNumber(name)) {
     return decodeNumber(name);
   } else {
     try {
       return Functions.getKeyId(name);
     } catch (IllegalArgumentException e) {
       throw excLine("Unknown key algorithm " + name);
     }
   }
 }