Package edu.harvard.hul.ois.jhove
Class Property
java.lang.Object
edu.harvard.hul.ois.jhove.Property
This class encapsulates arbitrary format-specific properties.
A Property's value can be a simple object or a structure.
If it is a simple object, it has arity SCALAR. If it is
a structure, it must be a Map, List, Set, or array, with
the corresponding arity. The simple object (in the case of
arity SCALAR) or the components of the structure must have a
type corresponding to one of the enumerations given by
PropertyType.
The components of a Property may themselves be Property
objects, allowing nested structures.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProperty(String name, PropertyType type, PropertyArity arity, Object value) Creates a Property with a given name, type, arity and value.Property(String name, PropertyType type, Object value) Creates a Property with arity SCALAR. -
Method Summary
Modifier and TypeMethodDescriptiongetArity()Returns the arity (type of structure) of this Property.Return a property by its name, regardless of its position in the structural hierarchy of properties.getName()Returns the displayable name of this Property.getType()Returns the type of this Property.getValue()Returns the Object which is the Property's value.
-
Constructor Details
-
Property
Creates a Property with arity SCALAR.- Parameters:
name- The displayable name of the propertytype- The type of propertyvalue- The value of the property. The type of the parameter must agree withtype.
-
Property
Creates a Property with a given name, type, arity and value.- Parameters:
name- The displayable name of the property.type- The type of property.arity- The arity of the property.value- The value of the property. If the arity is SCALAR, the type of this parameter must agree withtype. Otherwise, the arity must agree witharity, and its components must agree withtype.
-
-
Method Details
-
getArity
Returns the arity (type of structure) of this Property. -
getByName
Return a property by its name, regardless of its position in the structural hierarchy of properties.- Parameters:
name- Property name- Returns:
- Named property (or null)
-
getName
Returns the displayable name of this Property. -
getType
Returns the type of this Property. If the arity is other than SCALAR, the type refers to the compononents of the Property structure. -
getValue
Returns the Object which is the Property's value.
-