ElementType element,
int pos)
throws MibException {
Mib mib = symbol.getMib();
MibSymbol elementSymbol;
String name;
MibType type;
ObjectIdentifierValue value;
elementSymbol = mib.getSymbol(element.getName());
if (elementSymbol == null) {
if (element.getName() != null) {
name = pos + " '" + element.getName() + "'";
} else {
name = String.valueOf(pos);
}
log.addWarning(symbol.getLocation(),
"sequence element " + name + " is undefined " +
"in MIB, a default symbol will be created");
name = element.getName();
if (name == null) {
name = symbol.getName() + "." + pos;
}
type = new SnmpObjectType(element.getType(),
null,
SnmpAccess.READ_ONLY,
SnmpStatus.CURRENT,
"AUTOMATICALLY CREATED SYMBOL",
null,
new ArrayList(),
null);
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);
} else if (elementSymbol instanceof MibTypeSymbol) {
if (element.getName() != null) {
name = pos + " '" + element.getName() + "'";
} else {
name = String.valueOf(pos);