Esri Geoportal Server
1.0

com.esri.gpt.catalog.schema
Class Validation

java.lang.Object
  extended by com.esri.gpt.catalog.schema.Component
      extended by com.esri.gpt.catalog.schema.Validation

public class Validation
extends Component

Validation component associated with a metadata schema.

The component is configured from a node with a schema configuration XML document.

Example:
<validation required="true"/>


Field Summary
static String VALUETYPE_DATE
          Date = "date"
static String VALUETYPE_DOUBLE
          Double = "double"
static String VALUETYPE_EMAIL
          Email address = "email"
static String VALUETYPE_INTEGER
          Integer = "integer"
static String VALUETYPE_STRING
          String = "string" (this is the default)
 
Constructor Summary
Validation()
          Default constructor.
Validation(Validation objectToDuplicate)
          Construct by duplicating an existing object.
 
Method Summary
 void configure(CfgContext context, Node node, NamedNodeMap attributes)
          Configures the object based upon a node loaded from a schema configuration XML.
 Validation duplicate()
          Produces a deep clone of the object.
 void echo(StringBuffer sb)
          Appends property information for the component to a StringBuffer.
 String getNilReasonValue()
          Gets the associated ISO nil-reason value (if any).
 boolean getRequired()
          Gets the required status.
 String getValueType()
          Gets the value type.
 void setNilReasonValue(String reason)
          Sets the associated ISO nil-reason value (if any).
 void setRequired(boolean required)
          Sets the required status.
 void setValueType(String type)
          Sets the value type.
 void validate(Schema schema, Section section, Parameter parameter)
          Executes the validation of a parameter

Encountered errors should be appended to the schema.getValidationErrors() collection.

 
Methods inherited from class com.esri.gpt.catalog.schema.Component
getKey, setKey, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUETYPE_DATE

public static final String VALUETYPE_DATE
Date = "date"

See Also:
Constant Field Values

VALUETYPE_DOUBLE

public static final String VALUETYPE_DOUBLE
Double = "double"

See Also:
Constant Field Values

VALUETYPE_EMAIL

public static final String VALUETYPE_EMAIL
Email address = "email"

See Also:
Constant Field Values

VALUETYPE_INTEGER

public static final String VALUETYPE_INTEGER
Integer = "integer"

See Also:
Constant Field Values

VALUETYPE_STRING

public static final String VALUETYPE_STRING
String = "string" (this is the default)

See Also:
Constant Field Values
Constructor Detail

Validation

public Validation()
Default constructor.


Validation

public Validation(Validation objectToDuplicate)
Construct by duplicating an existing object.

Parameters:
objectToDuplicate - the object to duplicate
Method Detail

getNilReasonValue

public String getNilReasonValue()
Gets the associated ISO nil-reason value (if any).

Returns:
the nil-reason value

setNilReasonValue

public void setNilReasonValue(String reason)
Sets the associated ISO nil-reason value (if any).

Parameters:
reason - the nil-reason value

getRequired

public boolean getRequired()
Gets the required status.

Returns:
true if the parameter is required

setRequired

public void setRequired(boolean required)
Sets the required status.

Parameters:
required - true if the parameter is required

getValueType

public String getValueType()
Gets the value type.

Returns:
the value type

setValueType

public void setValueType(String type)
Sets the value type.

Parameters:
type - the value type

configure

public void configure(CfgContext context,
                      Node node,
                      NamedNodeMap attributes)
Configures the object based upon a node loaded from a schema configuration XML.
The super.configure method should be invoked prior to any sub-class configuration.

The following attributes are configured:
required valueType

Overrides:
configure in class Component
Parameters:
context - the configuration context
node - the configuration node
attributes - the attributes of the configuration node

duplicate

public Validation duplicate()
Produces a deep clone of the object.
The duplication constructor is invoked.
return new Validation(this);

Specified by:
duplicate in class Component

echo

public void echo(StringBuffer sb)
Appends property information for the component to a StringBuffer.
The method is intended to support "FINEST" logging.
super.echo should be invoked prior appending any local information.

Overrides:
echo in class Component
Parameters:
sb - the StringBuffer to use when appending information

validate

public void validate(Schema schema,
                     Section section,
                     Parameter parameter)
Executes the validation of a parameter

Encountered errors should be appended to the schema.getValidationErrors() collection.

Parameter values associated with meaning should be used to populate schema.getMeaning() values.

Parameters:
schema - the schema being validated
section - the section being validated
parameter - the parameter being validated

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.