Package net.percederberg.mibble

Examples of net.percederberg.mibble.MibValueSymbol


            value = (ObjectIdentifierValue) symbol.getValue();
            value = new ObjectIdentifierValue(symbol.getLocation(),
                                              value,
                                              element.getName(),
                                              pos);
            elementSymbol = new MibValueSymbol(symbol.getLocation(),
                                               mib,
                                               name,
                                               type,
                                               value);
            elementSymbol.initialize(log);
View Full Code Here


     *
     * @param oid            the OID to select
     */
    public void setSelectedNode(String oid) {
        MibNode         node = getSelectedNode();
        MibValueSymbol  symbol;
        TreePath        path;

        // Find matching symbol
        if (node == null || node.getSymbol() == null) {
            return;
View Full Code Here

     *
     * @return the SNMP object type of the current node symbol, or
     *         null if non-existent
     */
    public SnmpObjectType getSnmpObjectType() {
        MibValueSymbol  symbol = getSymbol();
       
        if (symbol != null && symbol.getType() instanceof SnmpObjectType) {
            return (SnmpObjectType) symbol.getType();
        } else {
            return null;
        }
    }
View Full Code Here

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

        Iterator        iter = symbols.values().iterator();
        MibValueSymbol  sym;
        String          message;

        if (constraint != null) {
            constraint.initialize(this, log);
        }
        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

     * symbols.
     *
     * @param values         the list of value symbols
     */
    private void createValueConstraints(ArrayList values) {
        MibValueSymbol   sym;
        ValueConstraint  c;

        for (int i = 0; i < values.size(); i++) {
            if (values.get(i) instanceof MibValueSymbol) {
                sym = (MibValueSymbol) values.get(i);
                symbols.put(sym.getName(), sym);
                // TODO: check value constraint compability
                c = new ValueConstraint(null, sym.getValue());
                if (constraint == null) {
                    constraint = c;
                } else {
                    constraint = new CompoundConstraint(constraint, c);
                }
View Full Code Here

     * @return a string representation of this type
     */
    public String toString() {
        StringBuffer    buffer = new StringBuffer();
        Iterator        iter;
        MibValueSymbol  symbol;

        buffer.append(super.toString());
        if (symbols.size() > 0) {
            buffer.append(" { ");
            iter = symbols.values().iterator();
            while (iter.hasNext()) {
                symbol = (MibValueSymbol) iter.next();
                buffer.append(symbol.getName());
                buffer.append("(");
                buffer.append(symbol.getValue());
                buffer.append(")");
                if (iter.hasNext()) {
                    buffer.append(", ");
                }
            }
View Full Code Here

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

        Iterator        iter = symbols.values().iterator();
        MibValueSymbol  sym;
        String          message;

        if (constraint != null) {
            constraint.initialize(this, log);
        }
        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

     * symbols.
     *
     * @param values         the list of value symbols
     */
    private void createValueConstraints(ArrayList values) {
        MibValueSymbol   sym;
        ValueConstraint  c;

        for (int i = 0; i < values.size(); i++) {
            if (values.get(i) instanceof MibValueSymbol) {
                sym = (MibValueSymbol) values.get(i);
                symbols.put(sym.getName(), sym);
                // TODO: check value constraint compability
                c = new ValueConstraint(null, sym.getValue());
                if (constraint == null) {
                    constraint = c;
                } else {
                    constraint = new CompoundConstraint(constraint, c);
                }
View Full Code Here

     * @return a string representation of this type
     */
    public String toString() {
        StringBuffer    buffer = new StringBuffer();
        Iterator        iter;
        MibValueSymbol  symbol;

        buffer.append(super.toString());
        if (symbols.size() > 0) {
            buffer.append(" { ");
            iter = symbols.values().iterator();
            while (iter.hasNext()) {
                symbol = (MibValueSymbol) iter.next();
                buffer.append(symbol.getName());
                buffer.append("(");
                buffer.append(symbol.getValue());
                buffer.append(")");
                if (iter.hasNext()) {
                    buffer.append(", ");
                }
            }
View Full Code Here

TOP

Related Classes of net.percederberg.mibble.MibValueSymbol

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.