public class AnnotationProfile extends Object implements PropertiesProvider
Constructor and Description |
---|
AnnotationProfile() |
Modifier and Type | Method and Description |
---|---|
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)
|
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 . |
public static void setDefaultProfile(AnnotationProfile defaultProfile)
public static AnnotationProfile getDefaultProfile()
public static AnnotationProfile load(URL 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.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.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)
public void setName(String name)
public String getName()
public List<AnnotationType> getTypes()
public List<AnnotationTemplate> getTemplates()
public AnnotationTemplate getTemplate(String name)
null
if there is no such template.null
public AnnotationType getType(String name)
null
if there is no such profile.null
public AnnotationFactory getFactory(String name)
null
public TypeSet getDefaultTypeSet()
@Deprecated public void setParentProfileSpec(String parentProfileSpec) throws JAXBException
parentProfileSpec
- the parentProfileSpec to setJAXBException
@Deprecated public String getParentProfileSpec()
public void setParentProfile(AnnotationProfile parentProfile)
public AnnotationProfile getParentProfile()
public boolean contains(AnnotationType type)
public Map<String,Object> getProperties()
PropertiesProvider
getProperties
in interface PropertiesProvider
@Deprecated public PropertiesDescriptor getPropDesc()
@Deprecated public void setPropDesc(PropertiesDescriptor propDesc)
Copyright © 2024 levigo holding gmbh. All rights reserved.