|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IAttributeRule
Provides access to members that return, modify and validate attribute rules.
IAttributeRule interface is used to maintain information about attribute rules. Validation of attribute rules is a function of this interface. Setting/retrieving the domain name, fieldname, subtypecode of a particular attribute rule are members of this interface.
IAttributeRule is for setting rules based on attributes for object classes. They describe the legal values for a field in an object class. For example, you might set an attribute rule that specifies wood poles can only be within a certain height range. You do this by establishing a range domain for pole heights and then using an attribute rule to apply this domain to a particular field in the pole object class, probably the height field.
IAttributeRule is the interface on a AttributeRule object used to get and set the properties of an Attribute Rule. You can use the Validate function of the attribute rule object to validate a particular row against this attribute rule. The validate function returns a boolean value of TRUE if it is valid and FALSE if it was not.
//Create a SDE workspace
IWorkspaceFactory pFact = null;
pFact = new SdeWorkspaceFactory();
//Open the connection to an sde server
IWorkspace pWorkspace = null;
pWorkspace = pFact.openFromFile("d:/MyConnections/sdeserver_vtest.sde", 0);
//workspace of that connection
IFeatureWorkspace pFeatws = null;
pFeatws = new IFeatureWorkspaceroxy(pWorkspace);
//feature dataset of that feature workspace
IFeatureDataset pFeatds =null;
pFeatds = pFeatws.openFeatureDataset("vtest.utilities");
IFeatureClassContainer pFeatclscont = null;
pFeatclscont = new IFeatureClassContainerProxy(pFeatds);
IFeatureClass pFeatcls = null;
pFeatcls = pFeatclscont.classByName("vtest.poles");
//Create a new attribute rule object to hold the new attribute rule
IAttributeRule pAttributeRule= null;
pAttributeRule = new AttributeRule();pAttributeRule.setCategory (1);
pAttributeRule.setDomainName ("Wood Pole Height Constraints");
pAttributeRule.setFieldName("height");
pAttributeRule.setHelpstring("Attribute rule for poles");
pAttributeRule.setSubtypeCode(200);
//Must create a rule object in order to add it to a feature class
IRule pRule = null;
pRule = newIRuleProxy(pAttributeRule);
IValidation pValidation = null;
pValidation = new IValidationProxy(pPFeatcls);
//Add the rule to the buildings featureclass
pValidation.addRule(pRule);
Method Summary | |
---|---|
String |
getDomainName()
The domain name associated with the attribute rule. |
String |
getFieldName()
The field name associated with the attribute rule. |
int |
getSubtypeCode()
The subtype code. |
void |
setDomainName(String name)
The domain name associated with the attribute rule. |
void |
setFieldName(String name)
The field name associated with the attribute rule. |
void |
setSubtypeCode(int value)
The subtype code. |
boolean |
validate(IRow row,
String[] errorMessage)
Validates the rule. |
Methods inherited from interface com.esri.arcgis.geodatabase.IRule |
---|
getCategory, getHelpstring, getID, getType, setCategory, setHelpstring, setID |
Method Detail |
---|
String getDomainName() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setDomainName(String name) throws IOException, AutomationException
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getFieldName() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setFieldName(String name) throws IOException, AutomationException
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getSubtypeCode() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setSubtypeCode(int value) throws IOException, AutomationException
value
- The value (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean validate(IRow row, String[] errorMessage) throws IOException, AutomationException
row
- A reference to a com.esri.arcgis.geodatabase.IRow (in)errorMessage
- The errorMessage (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |