usr/src/java/adr/org/opensolaris/os/adr/Property.java
changeset 699 34ec90cc612c
parent 564 f0779ed38052
--- a/usr/src/java/adr/org/opensolaris/os/adr/Property.java	Thu May 05 13:16:34 2011 -0700
+++ b/usr/src/java/adr/org/opensolaris/os/adr/Property.java	Fri May 06 14:55:38 2011 -0400
@@ -20,28 +20,36 @@
  */
 
 /*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
  */
 
 package org.opensolaris.os.adr;
 
-public class Property extends Feature implements PropertyError {
+public class Property extends Feature {
 
     private boolean readable_;
     private boolean writable_;
-    private Type readError_;
-    private Type writeError_;
+    private ADRError readError_;
+    private ADRError writeError_;
+    private Doc doc_;
 
     public Property(String name, Stability stability, Type t, boolean optional,
-        boolean readable, boolean writable, Type rerror, Type werror) {
+        boolean readable, boolean writable, ADRError rerror,
+	ADRError werror, Doc doc) {
 
-	super(name, stability, t, optional);
+	super(name, stability, t, optional, doc);
 	assert (readable || writable);
 	readable_ = readable;
 	writable_ = writable;
-
 	readError_ = rerror;
 	writeError_ = werror;
+	doc_ = doc;
+    }
+
+    public Property(String name, Stability stability, Type t, boolean optional,
+	boolean readable, boolean writable, ADRError rerror, ADRError werror) {
+	this(name, stability, t, optional, readable, writable, rerror, werror,
+	    null);
     }
 
     public boolean isReadable() {
@@ -52,13 +60,22 @@
 	return writable_;
     }
 
-    @Override
-    public Type getReadError() {
-	return readError_;
+    /*
+     * If the operation cannot fail, the error can be null.
+     */
+    public ADRError getReadError() {
+    	return readError_;
     }
 
-    @Override
-    public Type getWriteError() {
-	return writeError_;
+    public Type getReadErrorType() {
+	return readError_ != null ? readError_.getType() : null;
+    }
+
+    public ADRError getWriteError() {
+     	return writeError_;
+    }
+
+    public Type getWriteErrorType() {
+	return writeError_ != null ? writeError_.getType() : null;
     }
 }