Skip to content

Commit

Permalink
having some api elements support facets
Browse files Browse the repository at this point in the history
  • Loading branch information
stoicflame committed Oct 14, 2016
1 parent 1feceb9 commit db5e0b8
Show file tree
Hide file tree
Showing 27 changed files with 146 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.webcohesion.enunciate.api.HasAnnotations;
import com.webcohesion.enunciate.api.HasStyles;
import com.webcohesion.enunciate.facets.HasFacets;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;

import javax.lang.model.element.AnnotationMirror;
Expand All @@ -26,7 +27,7 @@
/**
* @author Ryan Heaton
*/
public interface DataType extends HasStyles, HasAnnotations {
public interface DataType extends HasStyles, HasAnnotations, HasFacets {

String getLabel();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

import com.webcohesion.enunciate.api.HasAnnotations;
import com.webcohesion.enunciate.api.HasStyles;
import com.webcohesion.enunciate.facets.HasFacets;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;

/**
* @author Ryan Heaton
*/
public interface Property extends HasStyles, HasAnnotations {
public interface Property extends HasStyles, HasAnnotations, HasFacets {

String getName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.webcohesion.enunciate.api.HasAnnotations;
import com.webcohesion.enunciate.api.HasStyles;
import com.webcohesion.enunciate.facets.HasFacets;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;

import java.util.List;
Expand All @@ -25,7 +26,7 @@
/**
* @author Ryan Heaton
*/
public interface Method extends HasStyles, HasAnnotations {
public interface Method extends HasStyles, HasAnnotations, HasFacets {

Resource getResource();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@

import com.webcohesion.enunciate.api.HasAnnotations;
import com.webcohesion.enunciate.api.HasStyles;
import com.webcohesion.enunciate.facets.HasFacets;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;

import java.util.List;

/**
* @author Ryan Heaton
*/
public interface Resource extends HasStyles, HasAnnotations {
public interface Resource extends HasStyles, HasAnnotations, HasFacets {

String getPath();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
import com.webcohesion.enunciate.api.HasAnnotations;
import com.webcohesion.enunciate.api.HasStyles;
import com.webcohesion.enunciate.api.PathSummary;
import com.webcohesion.enunciate.facets.HasFacets;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;

import java.util.List;

/**
* @author Ryan Heaton
*/
public interface ResourceGroup extends HasStyles, HasAnnotations {
public interface ResourceGroup extends HasStyles, HasAnnotations, HasFacets {

String getSlug();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
import com.webcohesion.enunciate.api.HasAnnotations;
import com.webcohesion.enunciate.api.HasStyles;
import com.webcohesion.enunciate.api.datatype.DataTypeReference;
import com.webcohesion.enunciate.facets.HasFacets;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;

/**
* @author Ryan Heaton
*/
public interface Fault extends HasStyles, HasAnnotations {
public interface Fault extends HasStyles, HasAnnotations, HasFacets {

String getName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
import com.webcohesion.enunciate.api.HasAnnotations;
import com.webcohesion.enunciate.api.HasStyles;
import com.webcohesion.enunciate.api.datatype.DataTypeReference;
import com.webcohesion.enunciate.facets.HasFacets;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;

import java.util.List;

/**
* @author Ryan Heaton
*/
public interface Operation extends HasStyles, HasAnnotations {
public interface Operation extends HasStyles, HasAnnotations, HasFacets {

String getName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@

import com.webcohesion.enunciate.api.HasAnnotations;
import com.webcohesion.enunciate.api.HasStyles;
import com.webcohesion.enunciate.facets.HasFacets;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;

import java.util.List;

/**
* @author Ryan Heaton
*/
public interface Service extends HasStyles, HasAnnotations {
public interface Service extends HasStyles, HasAnnotations, HasFacets {

String getLabel();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.fasterxml.jackson.annotation.JsonRootName;
import com.webcohesion.enunciate.api.Styles;
import com.webcohesion.enunciate.api.datatype.*;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.metadata.Label;
Expand Down Expand Up @@ -145,6 +146,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.typeDefinition.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.typeDefinition.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.typeDefinition.getJavaDoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.webcohesion.enunciate.api.Styles;
import com.webcohesion.enunciate.api.datatype.DataTypeReference;
import com.webcohesion.enunciate.api.datatype.Property;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.modules.jackson.model.Member;
Expand Down Expand Up @@ -69,6 +70,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.member.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.member.getFacets();
}

@Override
public boolean isRequired() {
return member.isRequired();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.webcohesion.enunciate.api.Styles;
import com.webcohesion.enunciate.api.datatype.*;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.metadata.Label;
Expand Down Expand Up @@ -145,6 +146,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.typeDefinition.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.typeDefinition.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.typeDefinition.getJavaDoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.webcohesion.enunciate.api.Styles;
import com.webcohesion.enunciate.api.datatype.DataTypeReference;
import com.webcohesion.enunciate.api.datatype.Property;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.modules.jackson1.model.Member;
Expand Down Expand Up @@ -69,6 +70,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.member.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.member.getFacets();
}

@Override
public boolean isRequired() {
return member.isRequired();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.webcohesion.enunciate.api.Styles;
import com.webcohesion.enunciate.api.datatype.*;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.metadata.Label;
Expand Down Expand Up @@ -115,6 +116,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.typeDefinition.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.typeDefinition.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.typeDefinition.getJavaDoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.webcohesion.enunciate.api.datatype.DataTypeReference;
import com.webcohesion.enunciate.api.datatype.Property;
import com.webcohesion.enunciate.api.datatype.PropertyMetadata;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.modules.jaxb.model.Accessor;
Expand Down Expand Up @@ -160,6 +161,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.accessor.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.accessor.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.accessor.getJavaDoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.webcohesion.enunciate.api.resources.Method;
import com.webcohesion.enunciate.api.resources.Resource;
import com.webcohesion.enunciate.api.resources.ResourceGroup;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.TypeElementComparator;
import com.webcohesion.enunciate.javac.javadoc.DefaultJavaDocTagHandler;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
Expand Down Expand Up @@ -148,6 +149,15 @@ public Map<String, AnnotationMirror> getAnnotations() {
return Collections.emptyMap();
}

@Override
public Set<Facet> getFacets() {
TreeSet<Facet> facets = new TreeSet<Facet>();
for (Resource resource : this.resources) {
facets.addAll(resource.getFacets());
}
return facets;
}

@Override
public JavaDoc getJavaDoc() {
return new JavaDoc(null, new DefaultJavaDocTagHandler());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.webcohesion.enunciate.api.Styles;
import com.webcohesion.enunciate.api.resources.*;
import com.webcohesion.enunciate.api.resources.Resource;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.modules.jaxrs.model.*;
Expand Down Expand Up @@ -176,6 +177,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.resourceMethod.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.resourceMethod.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.resourceMethod.getJavaDoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.webcohesion.enunciate.api.resources.Method;
import com.webcohesion.enunciate.api.resources.Resource;
import com.webcohesion.enunciate.api.resources.ResourceGroup;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.TypeElementComparator;
import com.webcohesion.enunciate.javac.javadoc.DefaultJavaDocTagHandler;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
Expand Down Expand Up @@ -138,6 +139,15 @@ public Map<String, AnnotationMirror> getAnnotations() {
return Collections.emptyMap();
}

@Override
public Set<Facet> getFacets() {
TreeSet<Facet> facets = new TreeSet<Facet>();
for (Resource resource : this.resources) {
facets.addAll(resource.getFacets());
}
return facets;
}

@Override
public JavaDoc getJavaDoc() {
return new JavaDoc(null, new DefaultJavaDocTagHandler());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.webcohesion.enunciate.api.resources.Method;
import com.webcohesion.enunciate.api.resources.Resource;
import com.webcohesion.enunciate.api.resources.ResourceGroup;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.facets.FacetFilter;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
Expand Down Expand Up @@ -146,6 +147,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.resourceClass.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.resourceClass.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.resourceClass.getJavaDoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.webcohesion.enunciate.api.resources.Method;
import com.webcohesion.enunciate.api.resources.Resource;
import com.webcohesion.enunciate.api.resources.ResourceGroup;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.modules.jaxrs.model.ResourceMethod;
Expand Down Expand Up @@ -99,6 +100,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.resourceMethod.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.resourceMethod.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.resourceMethod.getJavaDoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.webcohesion.enunciate.api.datatype.DataType;
import com.webcohesion.enunciate.api.datatype.DataTypeReference;
import com.webcohesion.enunciate.api.services.Fault;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.metadata.Label;
import com.webcohesion.enunciate.modules.jaxws.model.WebFault;
Expand Down Expand Up @@ -107,6 +108,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.fault.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.fault.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.fault.getJavaDoc();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.webcohesion.enunciate.api.services.Fault;
import com.webcohesion.enunciate.api.services.Operation;
import com.webcohesion.enunciate.api.services.Parameter;
import com.webcohesion.enunciate.facets.Facet;
import com.webcohesion.enunciate.javac.decorations.element.ElementUtils;
import com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
Expand Down Expand Up @@ -138,6 +139,11 @@ public Map<String, AnnotationMirror> getAnnotations() {
return this.webMethod.getAnnotations();
}

@Override
public Set<Facet> getFacets() {
return this.webMethod.getFacets();
}

@Override
public JavaDoc getJavaDoc() {
return this.webMethod.getJavaDoc();
Expand Down
Loading

0 comments on commit db5e0b8

Please sign in to comment.