Package net.percederberg.mibble

Examples of net.percederberg.mibble.MibValue


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

        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);
            list.add(value.initialize(log, null));
        }
        this.objects = list;
        return this;
    }
View Full Code Here


     */
    public MibValue initialize(MibLoaderLog log, MibType type)
        throws MibException {

        MibSymbol  sym;
        MibValue   value;
        String     message;

        sym = getSymbol(log);
        if (sym instanceof MibValueSymbol) {
            value = ((MibValueSymbol) sym).getValue();
            if (value != null) {
                value = value.initialize(log, type);
            }
            if (value == null) {
                return null;
            }
            try {
                value = value.createReference();
            } catch (UnsupportedOperationException e) {
                throw new MibException(location, e.getMessage());
            }
            if (!(value instanceof ObjectIdentifierValue)) {
                value.setReferenceSymbol((MibValueSymbol) sym);
            }
            return value;
        } else if (sym == null) {
            message = "undefined symbol '" + name + "'";
            throw new MibException(location, message);
View Full Code Here

     *             initialization
     */
    private void initialize(MibLoaderLog log, MibType type, ValueReference ref)
        throws 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 {

        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);
            list.add(value.initialize(log, null));
        }
        this.objects = list;
        return this;
    }
View Full Code Here

     * @param symbol         the MIB symbol
     *
     * @see #addToTree
     */
    private void addSymbol(TreeModel model, MibSymbol symbol) {
        MibValue               value;
        ObjectIdentifierValue  oid;

        if (symbol instanceof MibValueSymbol) {
            value = ((MibValueSymbol) symbol).getValue();
            if (value instanceof ObjectIdentifierValue) {
View Full Code Here

TOP

Related Classes of net.percederberg.mibble.MibValue

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.