Package net.percederberg.mibble.type

Examples of net.percederberg.mibble.type.StringType


     * @param indent         the indentation to use
     */
    private void printConstraint(MibType type, String indent) {
        IntegerType     intType;
        BitSetType      bitType;
        StringType      strType;

        if (type instanceof IntegerType) {
            intType = (IntegerType) type;
            if (intType.hasSymbols()) {
                os.println(" {");
                printEnumeration(intType.getAllSymbols(),
                                 indent + "    ");
                os.println();
                os.print(indent);
                os.print("}");
            } else if (intType.hasConstraint()) {
                os.print(" (");
                os.print(intType.getConstraint());
                os.print(")");
            }
        } else if (type instanceof BitSetType) {
            bitType = (BitSetType) type;
            if (bitType.hasSymbols()) {
                os.println(" {");
                printEnumeration(bitType.getAllSymbols(),
                                 indent + "    ");
                os.println();
                os.print(indent);
                os.print("}");
            } else if (bitType.hasConstraint()) {
                os.print(" (");
                os.print(bitType.getConstraint());
                os.print(")");
            }
        } else if (type instanceof StringType) {
            strType = (StringType) type;
            if (strType.hasConstraint()) {
                os.print(" (");
                os.print(strType.getConstraint());
                os.print(")");
            }
        }
    }
View Full Code Here


     * @param node           the node being exited
     *
     * @return the node to add to the parse tree
     */
    protected Node exitStringType(Production node) {
        StringType  type;
        ArrayList   values;

        values = getChildValues(node);
        if (values.size() == 0) {
            type = new StringType();
        } else {
            type = new StringType((Constraint) values.get(0));
        }
        node.addValue(type);
        return node;
    }
View Full Code Here

TOP

Related Classes of net.percederberg.mibble.type.StringType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.