net.percederberg.mib.type
Interface TypeConverter

All Known Implementing Classes:
TypeAdapter

public interface TypeConverter

An interface for transfering type information from types to other objects. All methods should at maximum be called once for each type, and the createX() methods are even mutually exclusive, meaning that only one of them may be called.

Version:
1.1
Author:
Per Cederberg, per@percederberg.net

Method Summary
 void createCompound(java.util.Vector symbols)
          Called for composed types.
 void createEnumeratedInteger(java.util.Vector labels, java.util.Vector values)
          Called for integer types that may only have one of an enumerated set of values.
 void createInteger()
          Called for integer types.
 void createString()
          Called for string types.
 void createVector(Type elementType)
          Called for vector types.
 void transferDefaultValue(int value)
          Called for types having a default value.
 void transferDefaultValue(java.lang.String value)
          Called for types having a default value.
 void transferNameAlias(java.lang.String name)
          Called to report a type name alias for this type.
 void transferReadable(boolean readable)
          Called to set the status of whether or not that data is readable from the data layer.
 void transferSizeLimits(int minLength, int maxLength)
          Called for types having size limits associated with them.
 void transferValueLimits(int minValue, int maxValue)
          Called for integer types having value limits associated with them.
 void transferWriteable(boolean writeable)
          Called to set the status of whether or not that data is writable to the data layer.
 

Method Detail

createInteger

public void createInteger()
Called for integer types.

createEnumeratedInteger

public void createEnumeratedInteger(java.util.Vector labels,
                                    java.util.Vector values)
Called for integer types that may only have one of an enumerated set of values.
Parameters:
labels - a vector with the string labels
values - a vector with the integer values

createString

public void createString()
Called for string types.

createVector

public void createVector(Type elementType)
Called for vector types.
Parameters:
elementType - the vector element type

createCompound

public void createCompound(java.util.Vector symbols)
Called for composed types.
Parameters:
symbols - a vector with the symbols that compose the type

transferNameAlias

public void transferNameAlias(java.lang.String name)
Called to report a type name alias for this type. This method is called once for each type symbol referenced from the type. The order will be the reverse, i.e. the inner-most name will be reported first.
Parameters:
name - the alias nam

transferValueLimits

public void transferValueLimits(int minValue,
                                int maxValue)
Called for integer types having value limits associated with them.
Parameters:
minValue - the minimum value
maxValue - the maximum value

transferSizeLimits

public void transferSizeLimits(int minLength,
                               int maxLength)
Called for types having size limits associated with them. Typically this can be either strings or arrays.
Parameters:
minLength - the minimum length, or -1 for none
maxLength - the maximum length, or -1 for none

transferReadable

public void transferReadable(boolean readable)
Called to set the status of whether or not that data is readable from the data layer.
Parameters:
readable - true if readable, false otherwise

transferWriteable

public void transferWriteable(boolean writeable)
Called to set the status of whether or not that data is writable to the data layer.
Parameters:
writeable - true if writeable, false otherwise

transferDefaultValue

public void transferDefaultValue(java.lang.String value)
Called for types having a default value.
Parameters:
value - a string value or a label, depending on context

transferDefaultValue

public void transferDefaultValue(int value)
Called for types having a default value.
Parameters:
value - an integer value