Package net.percederberg.mibble

Examples of net.percederberg.mibble.MibException


        MibValue  value = ref.initialize(log, type);

        if (value instanceof NumberValue) {
            this.value.set(((Number) value.toObject()).intValue());
        } else {
            throw new MibException(ref.getLocation(),
                                   "referenced value is not a number");
        }
    }
View Full Code Here


     */
    public MibType initialize(MibSymbol symbol, MibLoaderLog log)
        throws MibException {

        if (!(symbol instanceof MibValueSymbol)) {
            throw new MibException(symbol.getLocation(),
                                   "only values can have the " +
                                   getName() + " type");
        }
        for (int i = 0; i < modules.size(); i++) {
            ((SnmpModule) modules.get(i)).initialize(log);
View Full Code Here

        ArrayList  list = new ArrayList();
        MibValue   value;

        if (!(symbol instanceof MibValueSymbol)) {
            throw new MibException(symbol.getLocation(),
                                   "only values can have the " +
                                   getName() + " type");
        }
        for (int i = 0; i < objects.size(); i++) {
            value = (MibValue) objects.get(i);
View Full Code Here

     */
    public MibType initialize(MibSymbol symbol, MibLoaderLog log)
        throws MibException {

        if (!(symbol instanceof MibValueSymbol)) {
            throw new MibException(symbol.getLocation(),
                                   "only values can have the " +
                                   getName() + " type");
        }
        syntax = syntax.initialize(symbol, log);
        checkType((MibValueSymbol) symbol, log, syntax);
View Full Code Here

            if (element.getName() != null) {
                name = pos + " '" + element.getName() + "'";
            } else {
                name = String.valueOf(pos);
            }
            throw new MibException(symbol.getLocation(),
                                   "sequence element " + name +
                                   " does not refer to a value, but " +
                                   "to a type");
        }
    }
View Full Code Here

        if (sym instanceof MibTypeSymbol) {
            type = initializeReference(symbol, log, (MibTypeSymbol) sym);
            if (type == null) {
                message = "referenced symbol '" + sym.getName() +
                          "' contains undefined type";
                throw new MibException(location, message);
            }
            return type;
        } else if (sym == null) {
            message = "undefined symbol '" + name + "'";
            throw new MibException(location, message);
        } else {
            message = "referenced symbol '" + name + "' is not a type";
            throw new MibException(location, message);
        }
    }
View Full Code Here

            } else {
                type = type.createReference();
            }
            type = type.initialize(symbol, log);
        } catch (UnsupportedOperationException e) {
            throw new MibException(location, e.getMessage());
        }
        type.setReferenceSymbol(ref);
        initializeTypeTag(type, tag);
        return type;
    }
View Full Code Here

        while (iter.hasNext()) {
            sym = (MibValueSymbol) iter.next();
            sym.initialize(log);
            if (!(sym.getValue() instanceof NumberValue)) {
                message = "value is not compatible with type";
                throw new MibException(sym.getLocation(), message);
            }
        }
        return this;
    }
View Full Code Here

        while (iter.hasNext()) {
            sym = (MibValueSymbol) iter.next();
            sym.initialize(log);
            if (!isCompatibleType(sym.getValue())) {
                message = "value is not compatible with type";
                throw new MibException(sym.getLocation(), message);
            }
        }
        return this;
    }
View Full Code Here

TOP

Related Classes of net.percederberg.mibble.MibException

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.