|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.annotation.profiles.AnnotationProfile
public class AnnotationProfile
Constructor Summary | |
---|---|
AnnotationProfile()
|
Method Summary | |
---|---|
boolean |
contains(AnnotationType type)
Return whether this profile or a parent profile contain the given annotation type. |
boolean |
equals(Object obj)
|
static AnnotationProfile |
get(Document document)
Return the applicable AnnotationProfile for the given Document . |
static AnnotationProfile |
get(Page page)
Return the applicable AnnotationProfile for the given Document and Page
within. |
static AnnotationProfile |
getDefaultProfile()
|
TypeSet |
getDefaultTypeSet()
|
AnnotationFactory |
getFactory(String name)
Return the annotation factory for the given name. |
String |
getName()
|
AnnotationProfile |
getParentProfile()
|
String |
getParentProfileSpec()
Deprecated. XML mapping use only |
PropertiesDescriptor |
getPropDesc()
Deprecated. XML mapping use only |
Map<String,Object> |
getProperties()
Return a map of user properties. |
AnnotationTemplate |
getTemplate(String name)
Return the template with the given name or null if there is no such template. |
List<AnnotationTemplate> |
getTemplates()
|
AnnotationType |
getType(String name)
Return the type profile with the given name or null if there is no such profile. |
List<AnnotationType> |
getTypes()
|
TypeSet |
getTypeSet(String name)
|
List<TypeSet> |
getTypeSets()
|
int |
hashCode()
|
static AnnotationProfile |
load(URL profileURL)
Load an annotation profile from the given URL. |
static AnnotationProfile |
locateByName(String name)
Locate the an annotation profile by its name. |
static void |
main(String[] args)
|
static void |
registerAnnotationProfileLocator(AnnotationProfileLocator apl)
Registers an additional AnnotationProfileLocator . |
static void |
set(Document document,
AnnotationProfile ap)
Set the applicable AnnotationProfile for the given document. |
static void |
setDefaultProfile(AnnotationProfile defaultProfile)
|
void |
setName(String name)
|
void |
setParentProfile(AnnotationProfile parentProfile)
|
void |
setParentProfileSpec(String parentProfileSpec)
Deprecated. XML mapping use only |
void |
setPropDesc(PropertiesDescriptor propDesc)
Deprecated. XML mapping use only |
void |
setTypeSets(List<TypeSet> allTypeSets)
|
String |
toString()
|
static void |
unRegisterAnnotationProfileLocator(AnnotationProfileLocator apl)
Unregisters given AnnotationProfileLocator . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AnnotationProfile()
Method Detail |
---|
public static void setDefaultProfile(AnnotationProfile defaultProfile)
defaultProfile
- the defaultProfile to setpublic static AnnotationProfile getDefaultProfile()
public static AnnotationProfile load(URL profileURL)
profileURL
-
public static void main(String[] args) throws JAXBException, IOException
JAXBException
IOException
public static void registerAnnotationProfileLocator(AnnotationProfileLocator apl)
AnnotationProfileLocator
. Additional
AnnotationProfileLocator
will be preferably used to locate AnnotationProfile
s
by name. With this method it is possible to add as many additional
AnnotationProfileLocator
as necessary.
apl
- AnnotationProfileLocator
to be registeredlocateByName(String)
,
unRegisterAnnotationProfileLocator(AnnotationProfileLocator)
public static void unRegisterAnnotationProfileLocator(AnnotationProfileLocator apl)
AnnotationProfileLocator
.
apl
- AnnotationProfileLocator
to be unregisteredlocateByName(String)
,
registerAnnotationProfileLocator(AnnotationProfileLocator)
public static AnnotationProfile locateByName(String name)
AnnotationProfileLocator
is used to locate AnnotationProfile
s
by name. The locators are applied in the order in which they are registered. The first locator,
which successfully locate the demanded profile wins and the found profile returns. If no
registered AnnotationProfileLocator
is able to find a matching profile the lookup is
delegated to AnnotationProfileLocator
s which are found via META-INF/services lookup.
name
-
null
, if no locator was able to find it.registerAnnotationProfileLocator(AnnotationProfileLocator)
,
unRegisterAnnotationProfileLocator(AnnotationProfileLocator)
public static AnnotationProfile get(Document document)
AnnotationProfile
for the given Document
. Returns
null
, if the document doesn't have one.
document
-
AnnotationProfile
public static AnnotationProfile get(Page page)
AnnotationProfile
for the given Document
and Page
within. 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.
page
- The Page
for which to retrieve its AnnotationProfile
.
AnnotationProfile
public static void set(Document document, AnnotationProfile ap)
document
- ap
- public void setName(String name)
name
- the name to setpublic String getName()
public List<AnnotationType> getTypes()
public List<AnnotationTemplate> getTemplates()
public AnnotationTemplate getTemplate(String name)
null
if there is no such template.
name
-
null
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public AnnotationType getType(String name)
null
if there is no such profile.
name
-
null
public AnnotationFactory getFactory(String name)
name
-
null
public void setTypeSets(List<TypeSet> allTypeSets)
public List<TypeSet> getTypeSets()
public TypeSet getTypeSet(String name)
public TypeSet getDefaultTypeSet()
public String toString()
toString
in class Object
@Deprecated public void setParentProfileSpec(String parentProfileSpec) throws JAXBException
parentProfileSpec
- the parentProfileSpec to set
JAXBException
@Deprecated public String getParentProfileSpec()
public void setParentProfile(AnnotationProfile parentProfile)
parentProfile
- the parentProfile to setpublic AnnotationProfile getParentProfile()
public boolean contains(AnnotationType type)
type
-
public Map<String,Object> getProperties()
PropertiesProvider
getProperties
in interface PropertiesProvider
@Deprecated public PropertiesDescriptor getPropDesc()
@Deprecated public void setPropDesc(PropertiesDescriptor propDesc)
propDesc
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |