Skip to content

Commit

Permalink
Docs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
n1hility committed Aug 10, 2018
1 parent 2b5569a commit bfe5dfe
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 33 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/jboss/jandex/AnnotationInstance.java
Expand Up @@ -181,6 +181,7 @@ public AnnotationValue value() {
* @return the value of the specified parameter, the default, or null
* @throws IllegalArgumentException if index does not contain the defining
* annotation class
* @since 2.1
*/
public AnnotationValue valueWithDefault(IndexView index, String name) {
ClassInfo definition = index.getClassByName(this.name);
Expand Down Expand Up @@ -217,6 +218,7 @@ public AnnotationValue valueWithDefault(IndexView index, String name) {
* @return the "value" value, or its default, or null
* @throws IllegalArgumentException if index does not contain the defining
* annotation class
* @since 2.1
*/
public AnnotationValue valueWithDefault(IndexView index) {
return valueWithDefault(index, "value");
Expand All @@ -237,6 +239,7 @@ public AnnotationValue valueWithDefault(IndexView index) {
* @return the parameter values of this annotation
* @throws IllegalArgumentException if index does not contain the defining
* annotation class
* @since 2.1
*/
public List<AnnotationValue> valuesWithDefaults(IndexView index) {
ClassInfo definition = index.getClassByName(this.name);
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/org/jboss/jandex/ArrayType.java
Expand Up @@ -29,9 +29,13 @@ public final class ArrayType extends Type {
private int hash;

/**
* Create a new mock instance.
* Create a new mock array type instance with the specified component
* and dimensions.
*
* @return
* @param component the array component
* @param dimensions the number of dimensions of this array
* @return the new mock array type instance
* @since 2.1
*/
public static ArrayType create(Type component, int dimensions) {
return new ArrayType(component, dimensions);
Expand Down
43 changes: 23 additions & 20 deletions src/main/java/org/jboss/jandex/MethodInfo.java
Expand Up @@ -53,30 +53,33 @@ public final class MethodInfo implements AnnotationTarget {
}

/**
* Construct a new mock Method instance.
*
* @param clazz the class declaring the field
* @param name the name of the field
* @param args a read only array containing the types of each parameter in parameter order
* @param returnType the return value type
* @param flags the method attributes
* @return a mock method
*/
* Construct a new mock Method instance.
*
* @param clazz the class declaring the field
* @param name the name of the field
* @param args a read only array containing the types of each parameter in parameter order
* @param returnType the return value type
* @param flags the method attributes
* @return a mock method
*/
public static MethodInfo create(ClassInfo clazz, String name, Type[] args, Type returnType, short flags) {
return create(clazz, name, args, returnType, flags, null, null);
}

/**
* Construct a new mock Method instance.
*
* @param clazz
* @param name
* @param args
* @param returnType
* @param flags
* @param typeParameters
* @return a mock method
*/
/**
* Construct a new mock Method instance.
*
* @param clazz the class declaring the field
* @param name the name of the field
* @param args a read only array containing the types of each parameter in parameter order
* @param returnType the return value type
* @param flags the method attributes
* @param typeParameters the generic type parameters for this method
* @param exceptions the exceptions declared as thrown by this method
* @return a mock method
*
* @since 2.1
*/
public static MethodInfo create(ClassInfo clazz, String name, Type[] args, Type returnType, short flags, TypeVariable[] typeParameters, Type[] exceptions) {
if (clazz == null)
throw new IllegalArgumentException("Clazz can't be null");
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/org/jboss/jandex/ParameterizedType.java
Expand Up @@ -38,7 +38,7 @@
* </pre>
*
* <p>Another example shows the case where a parameterized type is used to represent a non-parameterized
* class (Y), whose owner (X) is itself parameterized:
* class (X), whose owner (Y) is itself parameterized:
* <pre class="brush:java; gutter:false">
* Y&lt;String&gt;.X
* </pre>
Expand All @@ -51,10 +51,11 @@ public class ParameterizedType extends Type {
/**
* Create a new mock instance.
*
* @param name
* @param arguments
* @param owner
* @param name the name of this type
* @param arguments an array of types representing arguments to this type
* @param owner the enclosing type if annotated or parameterized, otherwise null
* @return the mock instance
* @since 2.1
*/
public static ParameterizedType create(DotName name, Type[] arguments, Type owner) {
return new ParameterizedType(name, arguments, owner);
Expand Down Expand Up @@ -96,7 +97,7 @@ Type[] argumentsArray() {
* annotated may return null when this method is called.</p>
*
* <p>The example below shows the case where a parameterized type is used to represent a non-parameterized
* class (Y).
* class (X).
* <pre class="brush:java; gutter:false;">
* Y&lt;String&gt;.X
* </pre>
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/org/jboss/jandex/WildcardType.java
Expand Up @@ -33,11 +33,13 @@ public class WildcardType extends Type {
private int hash;

/**
* Create a new mock instance.
* Create a new mock instance of WildcardType.
*
* @param bound
* @param isExtends
* @return
* @param bound the bound (lower or upper)
* @param isExtends true if lower, false if upper (super)
* @return thew new mock instance
*
* @since 2.1
*/
public static WildcardType create(Type bound, boolean isExtends) {
return new WildcardType(bound, isExtends);
Expand All @@ -57,9 +59,9 @@ public static WildcardType create(Type bound, boolean isExtends) {

/**
* Returns the extends (upper) bound of this wildcard. If this wildcard declares a super (lower)
* bound, this method will return null
* bound, this method will return <code>java.lang.Object</code>
*
* @return the extends bound, or null if this wildcard has a super bound
* @return the extends bound, or Object if this wildcard has a super bound
*/
public Type extendsBound() {
return isExtends ? bound : OBJECT;
Expand Down

0 comments on commit bfe5dfe

Please sign in to comment.