Package org.apache.ivy.util.extendable
Class UnmodifiableExtendableItem
- java.lang.Object
-
- org.apache.ivy.util.extendable.UnmodifiableExtendableItem
-
- All Implemented Interfaces:
ExtendableItem
- Direct Known Subclasses:
AbstractIncludeExcludeRule
,ArtifactRevisionId
,DefaultDependencyArtifactDescriptor
,DefaultExtendableItem
,ModuleRevisionId
public class UnmodifiableExtendableItem extends java.lang.Object implements ExtendableItem
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>
attributes
private java.util.Map<java.lang.String,java.lang.String>
extraAttributes
private java.util.Map<java.lang.String,java.lang.String>
qualifiedExtraAttributes
private java.util.Map<java.lang.String,java.lang.String>
unmodifiableAttributesView
private java.util.Map<java.lang.String,java.lang.String>
unmodifiableExtraAttributesView
private java.util.Map<java.lang.String,java.lang.String>
unmodifiableQualifiedExtraAttributesView
-
Constructor Summary
Constructors Constructor Description UnmodifiableExtendableItem(java.util.Map<java.lang.String,java.lang.String> stdAttributes, java.util.Map<java.lang.String,java.lang.String> extraAttributes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAttribute(java.lang.String attName)
Gets the value of an attribute Can be used to access the value of a standard attribute (like organisation, revision) or of an extra attribute.java.util.Map<java.lang.String,java.lang.String>
getAttributes()
Returns a Map of all attributes of this extendable item, including standard and extra ones.java.lang.String
getExtraAttribute(java.lang.String attName)
Gets the value of an extra attribute Can be used only to access the value of an extra attribute, not a standard one (like organisation, revision)java.util.Map<java.lang.String,java.lang.String>
getExtraAttributes()
Returns a Map of all extra attributes of this extendable item.java.util.Map<java.lang.String,java.lang.String>
getQualifiedExtraAttributes()
Returns a Map of all extra attributes of this extendable item.protected void
setExtraAttribute(java.lang.String attName, java.lang.String attValue)
protected void
setStandardAttribute(java.lang.String attName, java.lang.String attValue)
-
-
-
Field Detail
-
attributes
private final java.util.Map<java.lang.String,java.lang.String> attributes
-
unmodifiableAttributesView
private final java.util.Map<java.lang.String,java.lang.String> unmodifiableAttributesView
-
extraAttributes
private final java.util.Map<java.lang.String,java.lang.String> extraAttributes
-
unmodifiableExtraAttributesView
private final java.util.Map<java.lang.String,java.lang.String> unmodifiableExtraAttributesView
-
qualifiedExtraAttributes
private final java.util.Map<java.lang.String,java.lang.String> qualifiedExtraAttributes
-
unmodifiableQualifiedExtraAttributesView
private final java.util.Map<java.lang.String,java.lang.String> unmodifiableQualifiedExtraAttributesView
-
-
Method Detail
-
getAttribute
public java.lang.String getAttribute(java.lang.String attName)
Description copied from interface:ExtendableItem
Gets the value of an attribute Can be used to access the value of a standard attribute (like organisation, revision) or of an extra attribute.- Specified by:
getAttribute
in interfaceExtendableItem
- Parameters:
attName
- the name of the attribute to get- Returns:
- the value of the attribute, null if the attribute doesn't exist
-
getExtraAttribute
public java.lang.String getExtraAttribute(java.lang.String attName)
Description copied from interface:ExtendableItem
Gets the value of an extra attribute Can be used only to access the value of an extra attribute, not a standard one (like organisation, revision)- Specified by:
getExtraAttribute
in interfaceExtendableItem
- Parameters:
attName
- the name of the extra attribute to get. This name can be either qualified or unqualified.- Returns:
- the value of the attribute, null if the attribute doesn't exist
-
setExtraAttribute
protected void setExtraAttribute(java.lang.String attName, java.lang.String attValue)
-
setStandardAttribute
protected void setStandardAttribute(java.lang.String attName, java.lang.String attValue)
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Description copied from interface:ExtendableItem
Returns a Map of all attributes of this extendable item, including standard and extra ones. The Map keys are attribute names as Strings, and values are corresponding attribute values (as String too). Extra attributes are included in unqualified form only.- Specified by:
getAttributes
in interfaceExtendableItem
- Returns:
- A Map instance containing all the attributes and their values.
-
getExtraAttributes
public java.util.Map<java.lang.String,java.lang.String> getExtraAttributes()
Description copied from interface:ExtendableItem
Returns a Map of all extra attributes of this extendable item. The Map keys are unqualified attribute names as Strings, and values are corresponding attribute values (as String too)- Specified by:
getExtraAttributes
in interfaceExtendableItem
- Returns:
- A Map instance containing all the extra attributes and their values.
- See Also:
ExtendableItem.getQualifiedExtraAttributes()
-
getQualifiedExtraAttributes
public java.util.Map<java.lang.String,java.lang.String> getQualifiedExtraAttributes()
Description copied from interface:ExtendableItem
Returns a Map of all extra attributes of this extendable item.The Map keys are qualified attribute names as Strings, and values are corresponding attribute values (as String too).
An attribute name is qualified with a namespace exactly the same way xml attributes are qualified. Thus qualified attribute names are of the form
prefix:name
- Specified by:
getQualifiedExtraAttributes
in interfaceExtendableItem
- Returns:
- A Map instance containing all the extra attributes and their values.
- See Also:
ExtendableItem.getExtraAttributes()
-
-