Package net.percederberg.mibble.type

Examples of net.percederberg.mibble.type.SequenceOfType


    private void printType(MibType type, String indent, int smiVersion) {
        MibType         refType;
        Constraint      refCons;
        Constraint      typeCons;
        SequenceType    seqType;
        SequenceOfType  seqOfType;

        if (type.getReferenceSymbol() != null) {
            os.print(type.getReferenceSymbol().getName());
            refType = type.getReferenceSymbol().getType();
            refCons = getConstraint(refType);
            typeCons = getConstraint(type);
            if (typeCons != null && typeCons != refCons) {
                printConstraint(type, indent);
            }
        } else if (type instanceof SequenceType) {           
            seqType = (SequenceType) type;
            os.println("SEQUENCE {");
            printTypeElements(seqType.getAllElements(),
                              indent + "    ",
                              smiVersion);
            os.println();
            os.print(indent);
            os.print("}");
        } else if (type instanceof SequenceOfType) {           
            seqOfType = (SequenceOfType) type;
            os.print("SEQUENCE ");
            if (seqOfType.getConstraint() != null) {
                 os.print("(");
                 os.print(seqOfType.getConstraint());
                 os.print(") ");
            }
            os.print("OF ");
            printType(seqOfType.getElementType(), indent, smiVersion);
        } else if (type instanceof IntegerType) {
            os.print("INTEGER");
            printConstraint(type, indent);
        } else if (type instanceof BitSetType) {
            os.print("BITS");
View Full Code Here


    private void checkType(MibValueSymbol symbol,
                           MibLoaderLog log,
                           MibType type)
        throws MibException {

        SequenceOfType  sequence;
        ElementType[]   elems;

        if (type instanceof SequenceOfType) {
            sequence = (SequenceOfType) type;
            checkType(symbol, log, sequence.getElementType());
        } else if (type instanceof SequenceType) {
            elems = ((SequenceType) type).getAllElements();
            for (int i = 0; i < elems.length; i++) {
                checkElement(symbol, log, elems[i], i + 1);
            }
View Full Code Here

        type = (MibType) getValue(child, 0);
        if (node.getChildCount() == 4) {
            child = getChildAt(node, 1);
            c = (Constraint) getValue(child, 0);
        }
        node.addValue(new SequenceOfType(type, c));
        return node;
    }
View Full Code Here

TOP

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

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.