Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Default values, various fixes

  • Loading branch information...
commit 3960ab500814b80d69714ebafd09be6045e06f89 1 parent 409f026
@dmlloyd authored
View
46 tool/src/main/java/org/jboss/mgmt/annotation/Default.java
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.mgmt.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
+/**
+ * Specify a default value for an attribute.
+ *
+ * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
+ */
+@Retention(CLASS)
+@Target(METHOD)
+public @interface Default {
+
+ /**
+ * The default value.
+ *
+ * @return the default value
+ */
+ String value();
+}
View
46 tool/src/main/java/org/jboss/mgmt/annotation/DefaultBoolean.java
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.mgmt.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
+/**
+ * Specify a default {@code boolean} value for an attribute.
+ *
+ * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
+ */
+@Retention(CLASS)
+@Target(METHOD)
+public @interface DefaultBoolean {
+
+ /**
+ * The default value.
+ *
+ * @return the default value
+ */
+ boolean value();
+}
View
46 tool/src/main/java/org/jboss/mgmt/annotation/DefaultInt.java
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.mgmt.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
+/**
+ * Specify a default {@code int} value for an attribute.
+ *
+ * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
+ */
+@Retention(CLASS)
+@Target(METHOD)
+public @interface DefaultInt {
+
+ /**
+ * The default value.
+ *
+ * @return the default value
+ */
+ int value();
+}
View
46 tool/src/main/java/org/jboss/mgmt/annotation/DefaultLong.java
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.mgmt.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
+/**
+ * Specify a default {@code long} value for an attribute.
+ *
+ * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
+ */
+@Retention(CLASS)
+@Target(METHOD)
+public @interface DefaultLong {
+
+ /**
+ * The default value.
+ *
+ * @return the default value
+ */
+ long value();
+}
View
8 tool/src/main/java/org/jboss/mgmt/annotation/Dependency.java
@@ -22,12 +22,20 @@
package org.jboss.mgmt.annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
/**
* Declare that this resource depends on a specific {@link Provides} from a specific {@link ResourceType}. A
* resource with this annotation will not be added without a satisfactory provider unless {@code optional} is {@code true}.
*
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
+@Retention(CLASS)
+@Target(METHOD)
public @interface Dependency {
/**
View
8 tool/src/main/java/org/jboss/mgmt/annotation/Provides.java
@@ -22,10 +22,18 @@
package org.jboss.mgmt.annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
/**
* Declare that this resource provides one or more services. Certain parent resources
* may restrict their child types to only allow one provider for each service.
*/
+@Retention(CLASS)
+@Target(METHOD)
public @interface Provides {
String[] value();
}
View
8 tool/src/main/java/org/jboss/mgmt/annotation/Required.java
@@ -22,9 +22,17 @@
package org.jboss.mgmt.annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
+@Retention(CLASS)
+@Target(METHOD)
public @interface Required {
boolean value() default true;
}
View
8 tool/src/main/java/org/jboss/mgmt/annotation/SubResource.java
@@ -22,11 +22,19 @@
package org.jboss.mgmt.annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
/**
* A reference to a nested resource.
*
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
+@Retention(CLASS)
+@Target(METHOD)
public @interface SubResource {
/**
Please sign in to comment.
Something went wrong with that request. Please try again.