public class RuleDefinition extends BaseHandle<InputStream,OutputStreamSender> implements OutputStreamSender, RuleReadHandle, RuleWriteHandle
Modifier and Type | Class and Description |
---|---|
static interface |
RuleDefinition.RuleMetadata
A RuleMetadata represents optional client-supplied metadata that is stored alongside a RuleDefinition.
|
UNKNOWN_LENGTH
Constructor and Description |
---|
RuleDefinition()
Make a new rule definition, no argument constructor.
|
RuleDefinition(String name,
String description)
Make a new rule definition
|
Modifier and Type | Method and Description |
---|---|
<T extends XMLReadHandle> |
exportQueryDefinition(T handle)
Exports the embedded query definitions and options to a handle
|
String |
getDescription()
Returns the rule's definition.
|
RuleDefinition.RuleMetadata |
getMetadata()
Gets the metadata object associated with this rule
|
String |
getName()
Gets the name of the rule.
|
void |
importQueryDefinition(XMLWriteHandle queryDef)
Imports an XML combined search definition that defines the matching
criteria for this rule.
|
void |
setDescription(String description)
Sets the description of the rule.
|
void |
setMetadata(RuleDefinition.RuleMetadata metadata)
Sets the metadata object for this rule.
|
void |
setName(String name)
Sets the name of the rule.
|
void |
write(OutputStream out)
Writes a serialized RuleDefinition to an OutputStream as XML.
|
getByteLength, getFormat, getMimetype, setByteLength, setFormat, setMimetype
public RuleDefinition(String name, String description)
name
- The name of the rule. Should be unique among rule names on the
REST server.description
- Text description of the rule.public RuleDefinition()
public void setName(String name)
name
- The rule's name.public String getName()
public void setDescription(String description)
description
- The rule's description.public String getDescription()
public void importQueryDefinition(XMLWriteHandle queryDef)
queryDef
- A combined raw query definition serialized as XML.public <T extends XMLReadHandle> T exportQueryDefinition(T handle)
T
- the type of XMLReadHandle to returnhandle
- The handle to use for export.public RuleDefinition.RuleMetadata getMetadata()
public void setMetadata(RuleDefinition.RuleMetadata metadata)
metadata
- The metadatapublic void write(OutputStream out) throws IOException
write
in interface OutputStreamSender
out
- the output stream receiving the contentIOException
- if io problems ariseCopyright © 2013-2016 MarkLogic Corporation.