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");