public class Rule extends java.lang.Object implements IWithExtAttributes
| Modifier and Type | Class and Description |
|---|---|
static class |
Rule.Normalization
Form of normalization possible.
|
static class |
Rule.Type
Types of validation rule.
|
| Constructor and Description |
|---|
Rule(Rule original)
Copy constructor.
|
Rule(java.lang.String type,
java.lang.String data)
Creates a rule of a given type.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getData() |
java.lang.String |
getDisplay()
Gets a human readable representation of the rule.
|
java.lang.String |
getEffectiveData()
Gets the effective text to use when applying the rule.
|
boolean |
getExistsInSource()
Gets the flag 'existsInSource'.
|
ExtAttributes |
getExtAttributes()
Gets the
ExtAttributes object for the parent object. |
java.lang.String |
getExtAttributeValue(java.lang.String namespaceURI,
java.lang.String localName)
Gets the value for a given extension attribute.
|
Rule.Normalization |
getNormalization() |
int |
getOccurs() |
Rule.Type |
getType() |
boolean |
hasExtAttribute()
Indicates if at least one extension attribute is present.
|
boolean |
isCaseSensitive() |
boolean |
isEnable()
Deprecated.
|
boolean |
isEnabled()
Indicates if this rule is enabled or not.
|
boolean |
isInherited()
Indicates if this rule is inherited from a parent object.
|
void |
prepare()
Creates the effective data from the data and flags for this rule.
|
void |
setCaseSensitive(boolean caseSensitive) |
void |
setData(java.lang.String data) |
void |
setEnable(boolean enable)
Deprecated.
|
void |
setEnabled(boolean enabled)
Sets the flag indicating if this rule is enabled or not.
|
void |
setExistsInSource(boolean existsInSource)
Sets the flag 'existsInSource'
|
void |
setExtAttributes(ExtAttributes attributes)
Sets the
ExtAttributes object associated with this object. |
void |
setInherited(boolean inherited)
Sets the flag indicating if this rule is inherited from a parent object.
|
void |
setNormalization(Rule.Normalization normalization) |
void |
setOccurs(int occurs) |
void |
setType(Rule.Type type) |
void |
verify()
Verifies if this rule has valid parameters.
|
public Rule(java.lang.String type,
java.lang.String data)
type - the name of the rule type.data - the text data for the rule (can be null).public Rule(Rule original)
original - the original object to duplicate.public java.lang.String getDisplay()
public Rule.Type getType()
public void setType(Rule.Type type)
public java.lang.String getData()
public void setData(java.lang.String data)
public java.lang.String getEffectiveData()
public int getOccurs()
public void setOccurs(int occurs)
public boolean getExistsInSource()
public void setExistsInSource(boolean existsInSource)
existsInSource - the flag 'existsinSource' to setpublic boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - true to enable this rule, false to disable it.@Deprecated public boolean isEnable()
isEnabled() instead of this method.@Deprecated public void setEnable(boolean enable)
setEnabled(boolean) instead of this method.enable - true to enable this rule, false to disable it.public Rule.Normalization getNormalization()
public void setNormalization(Rule.Normalization normalization)
public void setExtAttributes(ExtAttributes attributes)
IWithExtAttributesExtAttributes object associated with this object.setExtAttributes in interface IWithExtAttributesattributes - the ExtAttributes object associated with this object.
If null, a new ExtAttributes object is created.public boolean isInherited()
public void setInherited(boolean inherited)
inherited - true if this rule is inherited from a parent object, false otherwise.public ExtAttributes getExtAttributes()
IWithExtAttributesExtAttributes object for the parent object.
If none exists, one is created.getExtAttributes in interface IWithExtAttributesExtAttributes object for the parent object, never null.public boolean hasExtAttribute()
IWithExtAttributeshasExtAttribute in interface IWithExtAttributespublic java.lang.String getExtAttributeValue(java.lang.String namespaceURI,
java.lang.String localName)
IWithExtAttributesgetExtAttributeValue in interface IWithExtAttributesnamespaceURI - the URI of the namespace for the attribute.localName - the name of the attribute.public void prepare()
public void verify()
XLIFFException - if there is a problem with the rule's parameters.