Methods Summary |
---|
private com.sun.enterprise.admin.servermgmt.DomainConfigValidator$DomainConfigEntryInfo | get(java.lang.Object key)
for (int i = 0; i < entries.length; i++)
{
if (entries[i].key.equals(key)) { return entries[i]; }
}
return null;
|
public java.lang.String | getDataType(java.lang.Object key)
final DomainConfigEntryInfo info = get(key);
if (info != null)
{
return info.dataType;
}
return "";
|
public boolean | isKeyAllowed(java.lang.Object key)
return (get(key) != null);
|
protected abstract boolean | isValidate(java.lang.String name, java.lang.Object domainConfig)This method allows subclasses to say if an entry should be validated at
all. This is an attempt to add some flexibility to the otherwise static
validation. (Eg:- If we donot want to validate the ports during domain
creation)
|
public boolean | isValueValid(java.lang.Object key, java.lang.Object value)
boolean isValid = false;
final DomainConfigEntryInfo info = get(key);
if (info != null)
{
if (info.hasValidator())
{
try
{
info.validator.validate(value);
}
catch (InvalidConfigException idce)
{
isValid = false;
}
}
else
{
isValid = true;
}
}
return isValid;
|
public void | validate(java.lang.Object domainConfig)Validates the domainConfig. For each required domain config entry in the
entries, gets the value from the domainConfig object and invokes the
validator of that entry. Skips the validation of an entry if no validator
is specified for that entry.
super.validate(domainConfig);
for (int i = 0; i < entries.length; i++)
{
if (isValidate(entries[i].key, domainConfig))
{
final Object value = ((HashMap)domainConfig).get(entries[i].key);
if (entries[i].hasValidator())
{
entries[i].validator.validate(value);
}
}
}
|