com.adobe.icomm.assetplacement.model
Class Validator

java.lang.Object
  extended by com.adobe.icomm.assetplacement.model.Validator

public class Validator
extends Object

This class validates a PackageDefinition instance, returning an array of validation issues.


Field Summary
static String ERROR_CONTROLLER_ID_EMPTY
          A controller with an empty id.
static String ERROR_CONTROLLER_ID_INVALID
          A controller with an ID containing bad characters.
static String ERROR_CONTROLLER_ID_KEYWORD
          Controller ID conflicts with an ActionScript keyword.
static String ERROR_CONTROLLER_SIZE_MISSING
          Controller size required and not specified.
static String ERROR_CONTROLLER_SIZE_PERCENT
          Controller size was specified as a percentage, but must be absolute.
static String ERROR_MISSING_CONTROLLER
          Controller ID is referenced by an asset, but is missing from the package.
static String ERROR_MISSING_CONTROLLER_REFERENCE
          Controller ID reference is missing from an asset.
static String ERROR_PACKAGE_VERSION_INVALID
          Unknown package version.
static String ERROR_SLIDESHOW_DELAY_INVALID
          Controller size was specified as a percentage, but must be absolute.
static String ERROR_XFA_TYPE_REQUIRES_PACKAGE_2
          Package type XFA requires a package version of 2.0 or higher.
static String ID_REGEX
          Regular expression used to validate an ActionScript id.
static String WARN_UNRECOGNIZED_CONTROLLER
          A controller we don't recognize (ie, not PromoImage, PromoImageSlideShow, etc).
 
Constructor Summary
Validator()
           
 
Method Summary
 void addFormattedMessage(ValidationMessage message)
          Add a completely formatted message to the current list of validation messages.
 void addMessage(String messageId, boolean isError, Object[] args)
          Format and add a message to the current list of validation messages.
static String[] getReservedWordList()
          Accessor for the reserved words list.
 List validate(PackageDefinition packageDef)
          Run validation against the PackageDefinition instance passed in, and return a list of validation messages.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WARN_UNRECOGNIZED_CONTROLLER

public static final String WARN_UNRECOGNIZED_CONTROLLER
A controller we don't recognize (ie, not PromoImage, PromoImageSlideShow, etc).

See Also:
Constant Field Values

ERROR_CONTROLLER_ID_EMPTY

public static final String ERROR_CONTROLLER_ID_EMPTY
A controller with an empty id.

See Also:
Constant Field Values

ERROR_CONTROLLER_ID_INVALID

public static final String ERROR_CONTROLLER_ID_INVALID
A controller with an ID containing bad characters.

See Also:
Constant Field Values

ERROR_CONTROLLER_ID_KEYWORD

public static final String ERROR_CONTROLLER_ID_KEYWORD
Controller ID conflicts with an ActionScript keyword.

See Also:
Constant Field Values

ERROR_CONTROLLER_SIZE_MISSING

public static final String ERROR_CONTROLLER_SIZE_MISSING
Controller size required and not specified.

See Also:
Constant Field Values

ERROR_CONTROLLER_SIZE_PERCENT

public static final String ERROR_CONTROLLER_SIZE_PERCENT
Controller size was specified as a percentage, but must be absolute.

See Also:
Constant Field Values

ERROR_SLIDESHOW_DELAY_INVALID

public static final String ERROR_SLIDESHOW_DELAY_INVALID
Controller size was specified as a percentage, but must be absolute.

See Also:
Constant Field Values

ERROR_MISSING_CONTROLLER

public static final String ERROR_MISSING_CONTROLLER
Controller ID is referenced by an asset, but is missing from the package.

See Also:
Constant Field Values

ERROR_MISSING_CONTROLLER_REFERENCE

public static final String ERROR_MISSING_CONTROLLER_REFERENCE
Controller ID reference is missing from an asset.

See Also:
Constant Field Values

ERROR_PACKAGE_VERSION_INVALID

public static final String ERROR_PACKAGE_VERSION_INVALID
Unknown package version.

See Also:
Constant Field Values

ERROR_XFA_TYPE_REQUIRES_PACKAGE_2

public static final String ERROR_XFA_TYPE_REQUIRES_PACKAGE_2
Package type XFA requires a package version of 2.0 or higher.

See Also:
Constant Field Values

ID_REGEX

public static final String ID_REGEX
Regular expression used to validate an ActionScript id.

See Also:
Constant Field Values
Constructor Detail

Validator

public Validator()
Method Detail

getReservedWordList

public static String[] getReservedWordList()
Accessor for the reserved words list.

Returns:
the list of reserved keywords

validate

public List validate(PackageDefinition packageDef)
              throws InvalidPackageException
Run validation against the PackageDefinition instance passed in, and return a list of validation messages.

Parameters:
packageDef - the package to validate
Returns:
validation messages
Throws:
InvalidPackageException

addMessage

public void addMessage(String messageId,
                       boolean isError,
                       Object[] args)
Format and add a message to the current list of validation messages.

Parameters:
messageId - ID for the message, from the constants in this class
isError - true for errors, false for warnings
args - optional values used in formatting the message

addFormattedMessage

public void addFormattedMessage(ValidationMessage message)
Add a completely formatted message to the current list of validation messages.

Parameters:
message - the message to add


[an error occurred while processing this directive] [an error occurred while processing this directive]