xades4j.properties
Class DataObjectDesc

java.lang.Object
  extended by xades4j.properties.DataObjectDesc
Direct Known Subclasses:
AnonymousDataObjectReference, DataObjectReference, EnvelopedXmlObject, RawDataObjectDesc

public abstract class DataObjectDesc
extends Object

Base class for descriptions of the signed data objects. Each data object can be characterized by a set of transforms and a set of properties, specified via a fluent interface. class.

Author:
Luís
See Also:
EnvelopedXmlObject, DataObjectReference

Constructor Summary
protected DataObjectDesc()
           
 
Method Summary
 Collection<SignedDataObjectProperty> getSignedDataObjProps()
           
 Collection<DataObjectTransform> getTransforms()
           
 Collection<UnsignedDataObjectProperty> getUnsignedDataObjProps()
           
 boolean hasProperties()
           
 DataObjectDesc withCommitmentType(CommitmentTypeProperty commitment)
          Adds a CommitmentType signed property to the current data object description.
 DataObjectDesc withDataObjectFormat(DataObjectFormatProperty format)
          Adds a DataObjectFormat signed property to the current data object description.
 DataObjectDesc withDataObjectTimeStamp()
          Add a new IndividualDataObjectsTimeStamp signed property to the current data object description.
 DataObjectDesc withDataObjectTimeStamp(IndividualDataObjsTimeStampProperty timestamp)
          Add a IndividualDataObjectsTimeStamp signed property to the current data object description.
 DataObjectDesc withOtherDataObjectProperty(OtherSignedDataObjectProperty otherSignedDataObjProp)
          Adds a custom signed property to the current data object description.
 DataObjectDesc withOtherDataObjectProperty(OtherUnsignedDataObjectProperty otherUnsignedDataObjProp)
          Adds a custom unsigned property to the current data object description.
 DataObjectDesc withTransform(DataObjectTransform transf)
          Registers a transform to be applied to the data object at the signature generation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataObjectDesc

protected DataObjectDesc()
Method Detail

withTransform

public final DataObjectDesc withTransform(DataObjectTransform transf)
Registers a transform to be applied to the data object at the signature generation. Each transform will result in a ds:Transform element within the ds:Reference resulting from the current data object description.

Parameters:
transf - the transform to be applied
Returns:
the current instance
Throws:
NullPointerException - if transf is null
IllegalStateException - if the transform (instance) is already present

getTransforms

public Collection<DataObjectTransform> getTransforms()

withDataObjectFormat

public final DataObjectDesc withDataObjectFormat(DataObjectFormatProperty format)
Adds a DataObjectFormat signed property to the current data object description. The ObjectReference of the resulting property in the XAdES signature will refer the ds:Reference resulting from the current data object description. This property can only be defined once.

Parameters:
format - DataObjectFormat property
Returns:
the current instance
Throws:
NullPointerException - if format is null
PropertyTargetException - if a DataObjectFormat property is already present or format is already applied to another data object

withCommitmentType

public final DataObjectDesc withCommitmentType(CommitmentTypeProperty commitment)
Adds a CommitmentType signed property to the current data object description. The ObjectReference of the resulting property in the XAdES signature will refer the ds:Reference resulting from the current data object description. This method can be invoked multiple times with different properties since the signer may express multiple commitments towards the current data object. Furthermore, the same property instance can be added to different data object descriptions, since the signed can express the same commitment towards them.

Parameters:
commitment - CommitmentType property
Returns:
the current instance
Throws:
NullPointerException - if commitment is null
PropertyTargetException - if the property (instance) is already present

withDataObjectTimeStamp

public final DataObjectDesc withDataObjectTimeStamp(IndividualDataObjsTimeStampProperty timestamp)
Add a IndividualDataObjectsTimeStamp signed property to the current data object description. The Include list of the resulting property in the XAdES signature will refer the ds:Reference resulting from the current data object description. This method can be invoked multiple times with different properties since multiple instances of the property may exist in the signature and be applied to the current data object. Furthermore, the same property instance can be added to different data object descriptions since a single time-stamp may cover multiple data objects.

Parameters:
timestamp - the IndividualDataObjectsTimeStamp property
Returns:
the current instance
Throws:
NullPointerException - if timestamp is null
PropertyTargetException - if the property (instance) is already present

withDataObjectTimeStamp

public final DataObjectDesc withDataObjectTimeStamp()
Add a new IndividualDataObjectsTimeStamp signed property to the current data object description. This method is a shorcut for withDataObjectTimeStamp(xades4j.properties.IndividualDataObjsTimeStampProperty) that can be used when the time-stamp is not applied to other data objects.

Returns:
the current instance

withOtherDataObjectProperty

public final DataObjectDesc withOtherDataObjectProperty(OtherSignedDataObjectProperty otherSignedDataObjProp)
Adds a custom signed property to the current data object description. The purpose of this method is extensibility.

Each custom property needs a corresponding PropertyDataObjectGenerator which can be supplied through XadesSigningProfile.

Parameters:
otherSignedDataObjProp - the custom property
Returns:
the current instance
Throws:
NullPointerException - if otherSignedDataObjProp is null
PropertyTargetException - if the property is already present or is already applied to another data object (if it can't)
IllegalArgumentException - if the property is not properly annotated

withOtherDataObjectProperty

public final DataObjectDesc withOtherDataObjectProperty(OtherUnsignedDataObjectProperty otherUnsignedDataObjProp)
Adds a custom unsigned property to the current data object description. The purpose of this method is extensibility.

Each custom property needs a corresponding PropertyDataObjectGenerator which can be supplied through XadesSigningProfile.

Parameters:
otherUnsignedDataObjProp - the custom property
Returns:
the current instance
Throws:
NullPointerException - if otherUnsignedProp is null
PropertyTargetException - if the property is already present or is already applied to another data object (if it can't)
IllegalArgumentException - if the property is not properly annotated

hasProperties

public boolean hasProperties()

getSignedDataObjProps

public Collection<SignedDataObjectProperty> getSignedDataObjProps()

getUnsignedDataObjProps

public Collection<UnsignedDataObjectProperty> getUnsignedDataObjProps()


Copyright © 2012. All Rights Reserved.