public class EntityAttributesFilter extends Object implements MetadataFilter
EntityAttributes
extension content to entities in order to drive software
behavior based on them.
The entities to annotate are identified with a Predicate
, and multiple attributes can be
associated with each.Constructor and Description |
---|
EntityAttributesFilter()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
XMLObject |
filter(XMLObject metadata)
Filters the given metadata, perhaps to remove elements that are not wanted.
|
protected void |
filterEntitiesDescriptor(EntitiesDescriptor descriptor)
Filters entities descriptor.
|
protected void |
filterEntityDescriptor(EntityDescriptor descriptor)
Filters entity descriptor.
|
void |
setRules(Map<com.google.common.base.Predicate<EntityDescriptor>,Collection<Attribute>> rules)
Set the mappings from
Predicate to Attribute collection to apply. |
public void setRules(@Nonnull @NonnullElements Map<com.google.common.base.Predicate<EntityDescriptor>,Collection<Attribute>> rules)
Predicate
to Attribute
collection to apply.rules
- rules to apply@Nullable public XMLObject filter(@Nullable XMLObject metadata) throws FilterException
filter
in interface MetadataFilter
metadata
- the metadata to be filtered.FilterException
- thrown if an error occurs during the filtering processprotected void filterEntityDescriptor(@Nonnull EntityDescriptor descriptor)
descriptor
- entity descriptor to filterprotected void filterEntitiesDescriptor(@Nonnull EntitiesDescriptor descriptor)
descriptor
- entities descriptor to filterCopyright © 2018. All rights reserved.