com.microsoft.tfs.core.checkinpolicies
Class PolicyAnnotation

java.lang.Object
  extended by com.microsoft.tfs.core.checkinpolicies.PolicyAnnotation

public class PolicyAnnotation
extends java.lang.Object

A PolicyAnnotation contains one or more PolicyDefinitions, and can be serialized to and from a TFS annotation on a single team project.

Since:
TEE-SDK-10.1
Thread-safety:
immutable

Field Summary
static java.lang.String CHECKIN_POLICY_ANNOTATION_NAME
          The annotation name used in TFS.
static int SUPPORTED_VERSION
          The single data version we read and write.
 
Constructor Summary
PolicyAnnotation(PolicyDefinition[] definitions)
          Creates an annotation that holds the given definitions.
 
Method Summary
static PolicyAnnotation fromAnnotation(java.lang.String annotationValue)
          Reads a PolicyAnnotation from the given annotation value string.
 PolicyDefinition[] getDefinitions()
           
 java.lang.String toAnnotationValue()
          Encodes this PolicyAnnotation into a string suitable for storage in a TFS annotation value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHECKIN_POLICY_ANNOTATION_NAME

public static final java.lang.String CHECKIN_POLICY_ANNOTATION_NAME
The annotation name used in TFS. The annotation name was chosen for Teampr1se 3.0, and is retained in Team Explorer Everywhere for compatibility.

Constant Field Value:
"TeampriseCheckinPolicies"
See Also:
Constant Field Values

SUPPORTED_VERSION

public static final int SUPPORTED_VERSION
The single data version we read and write.

Constant Field Value:
1
See Also:
Constant Field Values
Constructor Detail

PolicyAnnotation

public PolicyAnnotation(PolicyDefinition[] definitions)
Creates an annotation that holds the given definitions. An annotation can not contain zero definitions (the annotation should be deleted entirely by higher-level code in this case).

Parameters:
definitions - an array of at least one definition (must not be null )
Method Detail

fromAnnotation

public static PolicyAnnotation fromAnnotation(java.lang.String annotationValue)
                                       throws PolicySerializationException
Reads a PolicyAnnotation from the given annotation value string.

Parameters:
annotationValue - the annotation value string to read from (must not be null)
Returns:
the new PolicyAnnotation containing all PolicyDefinitions loaded from the annotation.
Throws:
PolicySerializationException - if an error occurred reading the annotation value.

toAnnotationValue

public java.lang.String toAnnotationValue()
Encodes this PolicyAnnotation into a string suitable for storage in a TFS annotation value.

Returns:
a TFS annotation value containing this PolicyAnnotation's data.

getDefinitions

public PolicyDefinition[] getDefinitions()
Returns:
the definitions defined in this annotation.


© 2015 Microsoft. All rights reserved.