src/main/java/org/tinyradius/dictionary/DictionaryParser.java
private static void parseAttributeLine(WritableDictionary dictionary, StringTokenizer tok, int lineNum)
        throws IOException {
        if (tok.countTokens() != 3) {
            throw new IOException("syntax error on line " + lineNum);
        }

        // read name, code, type
        String name = tok.nextToken().trim();
        int code = Integer.parseInt(tok.nextToken());
        String typeStr = tok.nextToken().trim();

        // translate type to class
        Class<? extends RadiusAttribute> type;

        if (code == VendorSpecificAttribute.VENDOR_SPECIFIC) {
            type = VendorSpecificAttribute.class;
        }
        else {
            type = getAttributeTypeClass(code, typeStr);
        }

        // create and cache object
        dictionary.addAttributeType(new AttributeType(code, name, type));
    }
/**
     * Parse a line that declares an attribute.
     */
Parse a line that declares an attribute.
Parse a line that declares an attribute .
private static void parseAttributeLine(WritableDictionary dictionary, StringTokenizer tok, int lineNum)
        throws IOException {
        if (tok.countTokens() != 3) {
            throw new IOException("syntax error on line " + lineNum);
        }
        String name = tok.nextToken().trim();
        int code = Integer.parseInt(tok.nextToken());
        String typeStr = tok.nextToken().trim();
        Class<? extends RadiusAttribute> type;
        if (code == VendorSpecificAttribute.VENDOR_SPECIFIC) {
            type = VendorSpecificAttribute.class;
        }
        else {
            type = getAttributeTypeClass(code, typeStr);
        }
        dictionary.addAttributeType(new AttributeType(code, name, type));
    }
private static void parseAttributeLine ( WritableDictionary dictionary , StringTokenizer tok , int lineNum ) throws IOException { if ( tok . countTokens ( ) != 3 ) { throw new IOException ( "syntax error on line " + lineNum ) ; } String name = tok . nextToken ( ) . trim ( ) ; int code = Integer . parseInt ( tok . nextToken ( ) ) ; String typeStr = tok . nextToken ( ) . trim ( ) ; Class < ? extends RadiusAttribute > type ; if ( code == VendorSpecificAttribute . VENDOR_SPECIFIC ) { type = VendorSpecificAttribute . class ; } else { type = getAttributeTypeClass ( code , typeStr ) ; } dictionary . addAttributeType ( new AttributeType ( code , name , type ) ) ; }
Parse a line that declares an attribute.
Parse a line that declares an attribute .
// read name, code, type
 // translate type to class
 // create and cache object
