Class AnnotationProfile

java.lang.Object
com.levigo.jadice.annotation.profiles.AnnotationProfile

public class AnnotationProfile extends Object
  • Constructor Details

    • AnnotationProfile

      public AnnotationProfile()
  • Method Details

    • setDefaultProfile

      public static void setDefaultProfile(AnnotationProfile defaultProfile)
      Parameters:
      defaultProfile - the defaultProfile to set
    • getDefaultProfile

      public static AnnotationProfile getDefaultProfile()
      Returns:
      the defaultProfile
    • get

      public static AnnotationProfile get(Document document)
      Return the applicable AnnotationProfile for the given Document. Returns null, if the document doesn't have one.

      Caveat: this method only uses the first annotation page segment found on the given page using the ordering of Page.getPageSegments(). However, the latter is problematic as the default implementation does not return the segments in any predictable order but in order of the hash map they are maintained in. Future implementations will exhibit a clarified but different behavior.

      Parameters:
      document -
      Returns:
      the applicable AnnotationProfile
    • set

      public static void set(Document document, AnnotationProfile ap)
      Set the applicable AnnotationProfile for the given document.
      Parameters:
      document -
      ap -
    • setName

      public void setName(String name)
      Parameters:
      name - the name to set
    • getName

      public String getName()
      Returns:
      the name
    • getTypes

      public List<AnnotationType> getTypes()
      Returns:
      the typeProfiles
    • getTemplates

      public List<AnnotationTemplate> getTemplates()
      Returns:
      the templates
    • getTemplate

      public AnnotationTemplate getTemplate(String name)
      Return the template with the given name or null if there is no such template.
      Parameters:
      name -
      Returns:
      the template or null
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getType

      public AnnotationType getType(String name)
      Return the type profile with the given name or null if there is no such profile.
      Parameters:
      name -
      Returns:
      the type profile or null
    • getFactory

      public AnnotationFactory getFactory(String name)
      Return the annotation factory for the given name.
      Parameters:
      name -
      Returns:
      the type profile or null
    • setTypeSets

      public void setTypeSets(List<TypeSet> allTypeSets)
    • getTypeSets

      public List<TypeSet> getTypeSets()
    • getTypeSet

      public TypeSet getTypeSet(String name)
    • getDefaultTypeSet

      public TypeSet getDefaultTypeSet()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setParentProfile

      public void setParentProfile(AnnotationProfile parentProfile)
      Parameters:
      parentProfile - the parentProfile to set
    • getParentProfile

      public AnnotationProfile getParentProfile()
      Returns:
      the parentProfile
    • contains

      public boolean contains(AnnotationType type)
      Return whether this profile or a parent profile contain the given annotation type.
      Parameters:
      type -
      Returns: