The ClassType object is used to represent a type that is neither a field or method. Such a type is used when an object is to be used to populate a collection. In such a scenario there is no method or field annotations associated with the object.
Наследование: System.Type
Пример #1
0
 /// <summary>
 /// This is used to provide a configured empty value used when the
 /// annotated value is null. This ensures that XML can be created
 /// with required details regardless of whether values are null or
 /// not. It also provides a means for sensible default values.
 /// </summary>
 /// <param name="context">
 /// this is the context object for the serialization
 /// </param>
 /// <returns>
 /// this returns the string to use for default values
 /// </returns>
 public Object GetEmpty(Context context) {
    Type list = new ClassType(type);
    Factory factory = new CollectionFactory(context, list);
    if(!label.empty()) {
       return factory.getInstance();
    }
    return null;
 }
Пример #2
0
 /// <summary>
 /// This is used to provide a configured empty value used when the
 /// annotated value is null. This ensures that XML can be created
 /// with required details regardless of whether values are null or
 /// not. It also provides a means for sensible default values.
 /// </summary>
 /// <param name="context">
 /// this is the context object for the serialization
 /// </param>
 /// <returns>
 /// this returns the string to use for default values
 /// </returns>
 public Object GetEmpty(Context context) {
    Type array = new ClassType(type);
    Factory factory = new ArrayFactory(context, array);
    if(!label.empty()) {
       return factory.getInstance();
    }
    return null;
 }
Пример #3
0
 /// <summary>
 /// This is used to provide a configured empty value used when the
 /// annotated value is null. This ensures that XML can be created
 /// with required details regardless of whether values are null or
 /// not. It also provides a means for sensible default values.
 /// </summary>
 /// <param name="context">
 /// this is the context object for the serialization
 /// </param>
 /// <returns>
 /// this returns the string to use for default values
 /// </returns>
 public Object GetEmpty(Context context) {
    Type map = new ClassType(type);
    Factory factory = new MapFactory(context, map);
    if(!label.empty()) {
       return factory.getInstance();
    }
    return null;
 }