-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from gastaldi/ROASTER-28
ROASTER-28: Implemented Javadoc support
- Loading branch information
Showing
19 changed files
with
765 additions
and
18 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
api/src/main/java/org/jboss/forge/roaster/model/JavaDoc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright 2014 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.roaster.model; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import org.jboss.forge.roaster.Internal; | ||
import org.jboss.forge.roaster.Origin; | ||
|
||
/** | ||
* A {@link JavaDoc} represents Javadoc-style doc comment | ||
* | ||
* @author <a href="ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
public interface JavaDoc<O> extends Internal, Origin<O> | ||
{ | ||
/** | ||
* Returns the text for this {@link JavaDoc}, excluding tags | ||
*/ | ||
String getText(); | ||
|
||
/** | ||
* Returns the full text for this {@link JavaDoc}, including tags | ||
*/ | ||
String getFullText(); | ||
|
||
/** | ||
* Return the tag names for this {@link JavaDoc} | ||
*/ | ||
Set<String> getTagNames(); | ||
|
||
/** | ||
* Returns a list of {@link JavaDocTag} values for the given tag name (eg: @param) or an empty list if not found | ||
*/ | ||
List<JavaDocTag> getTags(String tagName); | ||
|
||
/** | ||
* Returns a list of {@link JavaDocTag} values for the given tag name (eg: @param) or an empty list if not found | ||
*/ | ||
List<JavaDocTag> getTags(); | ||
} |
26 changes: 26 additions & 0 deletions
26
api/src/main/java/org/jboss/forge/roaster/model/JavaDocCapable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright 2014 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.roaster.model; | ||
|
||
/** | ||
* Represents a {@link JavaType} that may support {@link JavaDoc} | ||
* | ||
* @author <a href="ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
public interface JavaDocCapable<O> | ||
{ | ||
/** | ||
* Returns the {@link JavaDoc} for this element. Never null. | ||
*/ | ||
JavaDoc<O> getJavaDoc(); | ||
|
||
/** | ||
* Returns if this {@link JavaType} already has a {@link JavaDoc} | ||
*/ | ||
boolean hasJavaDoc(); | ||
} |
28 changes: 28 additions & 0 deletions
28
api/src/main/java/org/jboss/forge/roaster/model/JavaDocTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright 2014 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.roaster.model; | ||
|
||
import org.jboss.forge.roaster.Internal; | ||
|
||
/** | ||
* Represents a {@link JavaDoc} tag, like the author tag below | ||
* | ||
* @author <a href="ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
public interface JavaDocTag extends Internal | ||
{ | ||
/** | ||
* The tag name | ||
*/ | ||
String getName(); | ||
|
||
/** | ||
* The tag value | ||
*/ | ||
String getValue(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
*/ | ||
package org.jboss.forge.roaster.model; | ||
|
||
|
||
/** | ||
* Represents a parameter of a {@link Method}. | ||
* | ||
|
27 changes: 27 additions & 0 deletions
27
api/src/main/java/org/jboss/forge/roaster/model/source/JavaDocCapableSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright 2014 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.roaster.model.source; | ||
|
||
import org.jboss.forge.roaster.model.JavaDoc; | ||
import org.jboss.forge.roaster.model.JavaDocCapable; | ||
|
||
/** | ||
* Represents a {@link JavaSource} element that can hold {@link JavaDoc} | ||
* | ||
* @author <a href="ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
public interface JavaDocCapableSource<O> extends JavaDocCapable<O> | ||
{ | ||
@Override | ||
JavaDocSource<O> getJavaDoc(); | ||
|
||
/** | ||
* Remove the associated {@link JavaDoc} | ||
*/ | ||
O removeJavaDoc(); | ||
} |
56 changes: 56 additions & 0 deletions
56
api/src/main/java/org/jboss/forge/roaster/model/source/JavaDocSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright 2014 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.roaster.model.source; | ||
|
||
import org.jboss.forge.roaster.model.JavaDoc; | ||
import org.jboss.forge.roaster.model.JavaDocTag; | ||
import org.jboss.forge.roaster.model.JavaType; | ||
|
||
/** | ||
* Represents a {@link JavaDoc} entry of a {@link JavaType}. | ||
* | ||
* @author <a href="ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
public interface JavaDocSource<O> extends JavaDoc<O> | ||
{ | ||
/** | ||
* Sets the whole {@link JavaDoc} text, including tags | ||
*/ | ||
JavaDocSource<O> setFullText(String text); | ||
|
||
/** | ||
* Sets the text for this {@link JavaDoc} (without any tags) | ||
*/ | ||
JavaDocSource<O> setText(String text); | ||
|
||
/** | ||
* Add a tag value for this {@link JavaDocSource} | ||
*/ | ||
JavaDocSource<O> addTagValue(String tagName, String tagValue); | ||
|
||
/** | ||
* Add a tag value given an existing {@link JavaDocTag} | ||
*/ | ||
JavaDocSource<O> addTagValue(JavaDocTag tag); | ||
|
||
/** | ||
* Removes the given tagName from this {@link JavaDoc} | ||
*/ | ||
JavaDocSource<O> removeTags(String tagName); | ||
|
||
/** | ||
* Removes the given {@link JavaDocTag} | ||
*/ | ||
JavaDocSource<O> removeTag(JavaDocTag tag); | ||
|
||
/** | ||
* Remove all tags | ||
*/ | ||
JavaDocSource<O> removeAllTags(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.