Skip to content

Commit

Permalink
Refactored is/setStatic into StaticCapable/Source
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Feb 12, 2015
1 parent 3d996ef commit 5562659
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
3 changes: 1 addition & 2 deletions api/src/main/java/org/jboss/forge/roaster/model/Member.java
Expand Up @@ -16,7 +16,6 @@
*
*/
public interface Member<O extends JavaType<O>> extends VisibilityScoped, AnnotationTarget<O>,
Origin<O>, Named, FinalCapable
Origin<O>, Named, FinalCapable, StaticCapable
{
public boolean isStatic();
}
21 changes: 21 additions & 0 deletions api/src/main/java/org/jboss/forge/roaster/model/StaticCapable.java
@@ -0,0 +1,21 @@
/**
* Copyright 2015 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 Java element that may support the <b>static</b> keyword
*
* @author <a href="ggastald@redhat.com">George Gastaldi</a>
*/
public interface StaticCapable
{
/**
* @return if the element is static
*/
boolean isStatic();
}
Expand Up @@ -16,7 +16,7 @@
*
*/
public interface MemberSource<O extends JavaSource<O>, T> extends Member<O>, AnnotationTargetSource<O, T>,
VisibilityScopedSource<T>, NamedSource<T>, JavaDocCapableSource<T>, FinalCapableSource<T>
VisibilityScopedSource<T>, NamedSource<T>, JavaDocCapableSource<T>, FinalCapableSource<T>,
StaticCapableSource<T>
{
public T setStatic(boolean statc);
}
@@ -0,0 +1,26 @@
/**
* Copyright 2015 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.StaticCapable;

/**
* Represents a Java element that supports the <b>static</b> keyword.
*
* @author <a href="ggastald@redhat.com">George Gastaldi</a>
*/
public interface StaticCapableSource<T> extends StaticCapable
{
/**
* Sets the <b>final</b> keyword in this element.
*
* @param value if this element should be set to static
* @return the generic element this interface is bound to
*/
T setStatic(boolean value);
}

0 comments on commit 5562659

Please sign in to comment.