Package org.eclipse.sisu.plexus
Class PlexusXmlMetadata
- java.lang.Object
-
- org.eclipse.sisu.plexus.PlexusXmlMetadata
-
- All Implemented Interfaces:
PlexusBeanMetadata
final class PlexusXmlMetadata extends java.lang.Object implements PlexusBeanMetadata
ConsumablePlexusBeanMetadata
that usesBeanProperty
names as keys.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Configuration>
configurationMap
private java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Requirement>
requirementMap
-
Constructor Summary
Constructors Constructor Description PlexusXmlMetadata(java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Configuration> configurationMap, java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Requirement> requirementMap)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static <K,V>
java.util.Map<K,V>addIfMissing(java.util.Map<K,V> primary, java.util.Map<K,V> secondary)
Looks for keys that exist in the secondary map, but not the primary, and adds their mappings to the primary map.org.codehaus.plexus.component.annotations.Configuration
getConfiguration(BeanProperty<?> property)
Returns @Configuration
metadata for the given property of the Plexus bean.org.codehaus.plexus.component.annotations.Requirement
getRequirement(BeanProperty<?> property)
Returns @Requirement
metadata for the given property of the Plexus bean.boolean
isEmpty()
(package private) void
merge(java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Configuration> extraConfiguration, java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Requirement> extraRequirements)
Merges the given configuration and requirements with the current metadata, without overwriting existing entries.
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePlexusBeanMetadata
- Returns:
true
if there is no more metadata; otherwisefalse
-
getConfiguration
public org.codehaus.plexus.component.annotations.Configuration getConfiguration(BeanProperty<?> property)
Description copied from interface:PlexusBeanMetadata
Returns @Configuration
metadata for the given property of the Plexus bean.- Specified by:
getConfiguration
in interfacePlexusBeanMetadata
- Parameters:
property
- The bean property- Returns:
- Configuration metadata;
null
if no such metadata is available
-
getRequirement
public org.codehaus.plexus.component.annotations.Requirement getRequirement(BeanProperty<?> property)
Description copied from interface:PlexusBeanMetadata
Returns @Requirement
metadata for the given property of the Plexus bean.- Specified by:
getRequirement
in interfacePlexusBeanMetadata
- Parameters:
property
- The bean property- Returns:
- Requirement metadata;
null
if no such metadata is available
-
merge
void merge(java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Configuration> extraConfiguration, java.util.Map<java.lang.String,org.codehaus.plexus.component.annotations.Requirement> extraRequirements)
Merges the given configuration and requirements with the current metadata, without overwriting existing entries.- Parameters:
extraConfiguration
- The extra configurationextraRequirements
- The extra requirements
-
addIfMissing
private static <K,V> java.util.Map<K,V> addIfMissing(java.util.Map<K,V> primary, java.util.Map<K,V> secondary)
Looks for keys that exist in the secondary map, but not the primary, and adds their mappings to the primary map.- Parameters:
primary
- The primary mapsecondary
- The secondary map
-
-