--- a/usr/src/java/adr/org/opensolaris/os/adr/Type.java Thu May 05 13:16:34 2011 -0700
+++ b/usr/src/java/adr/org/opensolaris/os/adr/Type.java Fri May 06 14:55:38 2011 -0400
@@ -48,7 +48,7 @@
@Override
public String toString() {
- return type_.toString();
+ return type_.toString().toLowerCase();
}
}
@@ -81,13 +81,20 @@
public static class ComplexType extends DefinedType {
private List<Field> fields_;
private List<ComplexType> parents_;
+ private Doc doc_;
public ComplexType(String name, List<Field> fields,
- List<ComplexType> parents) {
+ List<ComplexType> parents, Doc doc) {
super(Source.COMPLEX, name);
fields_ = fields;
parents_ = parents;
+ doc_ = doc;
+ }
+
+ public ComplexType(String name, List<Field> fields,
+ List<ComplexType> parents) {
+ this(name, fields, parents, null);
}
public List<Field> getFields() {
@@ -98,6 +105,10 @@
return parents_;
}
+ public Doc getDoc() {
+ return doc_;
+ }
+
public List<Field> getAllFields() {
if (parents_ == null)
return fields_;
@@ -134,10 +145,16 @@
public static class EnumValue {
private String name_;
private int value_;
+ private Doc doc_;
+
+ public EnumValue(String name, int value, Doc doc) {
+ name_ = name;
+ value_ = value;
+ doc_ = doc;
+ }
public EnumValue(String name, int value) {
- name_ = name;
- value_ = value;
+ this(name, value, null);
}
public String getName() {
@@ -147,16 +164,28 @@
public int getValue() {
return value_;
}
+
+ public Doc getDoc() {
+ return doc_;
+ }
}
public static class EnumType extends DefinedType {
private List<EnumValue> values_;
private EnumValue fallback_;
+ private Doc doc_;
- public EnumType(String name, List<EnumValue> values, String fallback) {
+ public EnumType(String name, List<EnumValue> values, EnumValue fallback,
+ Doc doc) {
super(Source.ENUM, name);
values_ = values;
- fallback_ = fallback != null ? new EnumValue(fallback, 0) : null;
+ fallback_ = fallback;
+ doc_ = doc;
+ }
+
+ public EnumType(String name, List<EnumValue> values,
+ EnumValue fallback) {
+ this(name, values, fallback, null);
}
public List<EnumValue> getValues() {
@@ -167,6 +196,10 @@
return fallback_;
}
+ public Doc getDoc() {
+ return doc_;
+ }
+
@Override
public String toString() {
return "enum " + getName();
@@ -182,21 +215,24 @@
((Type.ForwardType)type).addReference(this);
}
+ @Override
public void setType(Type type) {
type_ = type;
}
+ @Override
public Type getType() {
return (type_);
}
+ @Override
public boolean isOptional() {
return false;
}
@Override
public String toString() {
- return "array of " + type_.toString();
+ return type_.toString() + "[]";
}
}