org.kite9.diagram.builders
Class ClassBuilder

java.lang.Object
  extended by org.kite9.diagram.builders.AbstractBuilder
      extended by org.kite9.diagram.builders.AbstractElementBuilder<X>
          extended by org.kite9.diagram.builders.AnnotatedElementBuilder<Class<?>>
              extended by org.kite9.diagram.builders.ClassBuilder

public class ClassBuilder
extends AnnotatedElementBuilder<Class<?>>


Nested Class Summary
protected static interface ClassBuilder.ClassContentSelector<T>
           
 
Nested classes/interfaces inherited from class org.kite9.diagram.builders.AbstractElementBuilder
AbstractElementBuilder.ContentSelector<T,S>
 
Field Summary
 
Fields inherited from class org.kite9.diagram.builders.AbstractElementBuilder
ties
 
Fields inherited from class org.kite9.diagram.builders.AbstractBuilder
a, model, nf
 
Constructor Summary
ClassBuilder(List<Tie> forX, ProjectModel model, Aliaser a)
           
 
Method Summary
protected
<Y> List<Tie>
packContent(Collection<Tie> in, Filter<? super Y> f, ClassBuilder.ClassContentSelector<Y> ccs, boolean traverse, Relationship r)
          This is a helper method used to create a list of ties correctly, by applying a ContentSelector.
protected
<Y> void
packContentInner(Collection<Tie> in, Filter<? super Y> f, ClassBuilder.ClassContentSelector<Y> ccs, boolean traverse, Relationship r, List<Tie> out)
           
protected
<Y> void
packContentInner2(NounPart subject, Collection<? extends Class<?>> in, Filter<? super Y> f, ClassBuilder.ClassContentSelector<Y> ccs, boolean traverse, Relationship r, List<Tie> out)
           
 ClassBuilder reduce(Filter<? super Class<?>> f)
          Creates a new element builder of the same type as the original, which only has ties matching the filter.
 ClassBuilder show(Format f)
           
 ClassBuilder showFinal(Format f)
           
 ClassBuilder showStatic(Format f)
           
 ClassBuilder showVisibility(Format f)
           
 ClassBuilder withAnnotatedClasses(Filter<? super Class<?>> f)
          Assumes that the classes in this builder are annotations, and provides you with a classbuilder of classes that have declared these annotations.
 ClassBuilder withCalledClasses(Filter<? super Class<?>> f, boolean traverse)
          Returns classes which are called by this one
 MethodBuilder withCalledMethods(Filter<? super Method> f, boolean traverse)
          Returns methods which are called by this class
 ClassBuilder withCallingClasses(Filter<? super Class<?>> f, boolean traverse)
          Returns classes calling this one
 MethodBuilder withCallingMethods(Filter<? super Method> f, boolean traverse)
          Returns classes calling this one
 ClassBuilder withDependants(Filter<? super Class<?>> f, boolean traverse)
          Returns classes which require this class to work.
 ClassBuilder withDependencies(Filter<? super Class<?>> f, boolean traverse)
          Returns classes which this class depends on to work.
 FieldBuilder withFields(Filter<? super Field> f, boolean traverse)
          Creates a helper to allow you to manipulate fields on this class.
 ClassBuilder withInnerClasses(Filter<? super Class<?>> f, boolean traverse)
          Creates a helper to allow you to manipulate inner classes on this class.
 ClassBuilder withInterfaces(Filter<? super Class<?>> f, boolean traverse)
          Creates a helper to allow you to manipulate the interfaces this class implements or extends
 MethodBuilder withMethods(Filter<? super Method> f, boolean traverse)
          Creates a helper to allow you to manipulate methods on this class.
 AnnotatedElementBuilder<?> withReferencingAnnotatedElements(Filter<? super AnnotatedElement> f)
          Returns ties for all of the annotated elements which reference this class, via an annotation.
 AnnotationBuilder withReferencingAnnotations(Filter<? super Annotation> f)
          Returns ties for all of the annotations which reference this class
 ClassBuilder withSubClasses(Filter<? super Class<?>> f, boolean traverse)
          Creates a helper to allow you to manipulate subclasses within the project of the current class or classes.
 ClassBuilder withSuperClasses(Filter<? super Class<?>> f)
          Creates a helper to allow you to manipulate the superclasses of the classes that this builder manages.
 
Methods inherited from class org.kite9.diagram.builders.AnnotatedElementBuilder
withAnnotations
 
Methods inherited from class org.kite9.diagram.builders.AbstractElementBuilder
getRepresented, getTieForRepresentation, reduceInner, withClasses, withPackages, withPackages, withStrings
 
Methods inherited from class org.kite9.diagram.builders.AbstractBuilder
createNewSubjectNounPart, createNoun, createTies, getCurrentClassLoader, getNounFactory, getUnderlyingSimpleNoun, packagesOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassBuilder

public ClassBuilder(List<Tie> forX,
                    ProjectModel model,
                    Aliaser a)
Method Detail

showVisibility

public ClassBuilder showVisibility(Format f)

showStatic

public ClassBuilder showStatic(Format f)

show

public ClassBuilder show(Format f)
Overrides:
show in class AbstractElementBuilder<Class<?>>

showFinal

public ClassBuilder showFinal(Format f)

withSuperClasses

public ClassBuilder withSuperClasses(Filter<? super Class<?>> f)
Creates a helper to allow you to manipulate the superclasses of the classes that this builder manages.

Parameters:
f - An optional filter to reduce the number of interfaces being considered.

withInterfaces

public ClassBuilder withInterfaces(Filter<? super Class<?>> f,
                                   boolean traverse)
Creates a helper to allow you to manipulate the interfaces this class implements or extends

Parameters:
f - An optional filter to reduce the number of interfaces being considered.
traverse - Set to true if you want interfaces declared by superclasses and superinterfaces too

withMethods

public MethodBuilder withMethods(Filter<? super Method> f,
                                 boolean traverse)
Creates a helper to allow you to manipulate methods on this class.

Parameters:
f - An optional filter to reduce the number of methods being considered.

withInnerClasses

public ClassBuilder withInnerClasses(Filter<? super Class<?>> f,
                                     boolean traverse)
Creates a helper to allow you to manipulate inner classes on this class.

Parameters:
f - An optional filter to reduce the number of methods being considered.

withSubClasses

public ClassBuilder withSubClasses(Filter<? super Class<?>> f,
                                   boolean traverse)
Creates a helper to allow you to manipulate subclasses within the project of the current class or classes.

Parameters:
f - Optional filter to reduce the number of returned classes
traverse - set to true if you want the entire subclass tree (i.e. sub-sub-classes etc)s
Returns:

withFields

public FieldBuilder withFields(Filter<? super Field> f,
                               boolean traverse)
Creates a helper to allow you to manipulate fields on this class.

Parameters:
f - An optional filter to reduce the number of methods being considered.

packContent

protected <Y> List<Tie> packContent(Collection<Tie> in,
                                    Filter<? super Y> f,
                                    ClassBuilder.ClassContentSelector<Y> ccs,
                                    boolean traverse,
                                    Relationship r)
This is a helper method used to create a list of ties correctly, by applying a ContentSelector.


packContentInner

protected <Y> void packContentInner(Collection<Tie> in,
                                    Filter<? super Y> f,
                                    ClassBuilder.ClassContentSelector<Y> ccs,
                                    boolean traverse,
                                    Relationship r,
                                    List<Tie> out)

packContentInner2

protected <Y> void packContentInner2(NounPart subject,
                                     Collection<? extends Class<?>> in,
                                     Filter<? super Y> f,
                                     ClassBuilder.ClassContentSelector<Y> ccs,
                                     boolean traverse,
                                     Relationship r,
                                     List<Tie> out)

reduce

public ClassBuilder reduce(Filter<? super Class<?>> f)
Description copied from class: AbstractElementBuilder
Creates a new element builder of the same type as the original, which only has ties matching the filter.

Overrides:
reduce in class AnnotatedElementBuilder<Class<?>>

withAnnotatedClasses

public ClassBuilder withAnnotatedClasses(Filter<? super Class<?>> f)
Assumes that the classes in this builder are annotations, and provides you with a classbuilder of classes that have declared these annotations.


withReferencingAnnotations

public AnnotationBuilder withReferencingAnnotations(Filter<? super Annotation> f)
Returns ties for all of the annotations which reference this class


withReferencingAnnotatedElements

public AnnotatedElementBuilder<?> withReferencingAnnotatedElements(Filter<? super AnnotatedElement> f)
Returns ties for all of the annotated elements which reference this class, via an annotation.


withCallingClasses

public ClassBuilder withCallingClasses(Filter<? super Class<?>> f,
                                       boolean traverse)
Returns classes calling this one


withCallingMethods

public MethodBuilder withCallingMethods(Filter<? super Method> f,
                                        boolean traverse)
Returns classes calling this one


withCalledClasses

public ClassBuilder withCalledClasses(Filter<? super Class<?>> f,
                                      boolean traverse)
Returns classes which are called by this one


withCalledMethods

public MethodBuilder withCalledMethods(Filter<? super Method> f,
                                       boolean traverse)
Returns methods which are called by this class


withDependencies

public ClassBuilder withDependencies(Filter<? super Class<?>> f,
                                     boolean traverse)
Returns classes which this class depends on to work.


withDependants

public ClassBuilder withDependants(Filter<? super Class<?>> f,
                                   boolean traverse)
Returns classes which require this class to work.



Copyright © 2011. All Rights Reserved.