org.drools.eclipse.dsl.editor
Class DSLAdapter

java.lang.Object
  extended by org.drools.eclipse.dsl.editor.DSLAdapter

public class DSLAdapter
extends Object

This holds the DSL configuration for an editor instance. When loading, it will find the DSL file, and load the applicable lists. This provides a link between the editor and the DSL features of the rule language. It will look for a DSL configuration, as named in the rule file, in the same directory as the rule file. Failing this, it will search one directory above the rule file. Failing that, it will search the root of the project in the workspace.


Constructor Summary
DSLAdapter(String content, org.eclipse.core.resources.IFile input)
          This will sniff out the DSL config file name from the content.
 
Method Summary
static Reader getDSLContent(String ruleSource, org.eclipse.core.resources.IResource input)
          Get a reader to the DSL contents
 DSLTree getDSLTree()
           
 boolean hasConditions()
           
 boolean hasConsequences()
           
 boolean isValid()
           
 List listConditionItems()
           
 List listConsequenceItems()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSLAdapter

public DSLAdapter(String content,
                  org.eclipse.core.resources.IFile input)
           throws org.eclipse.core.runtime.CoreException
This will sniff out the DSL config file name from the content. It will then use the IFile input to search around for the file itself. TODO: provide an alternative that just loads off a stream (for non IDEs workbenches like jlibrary).

Parameters:
content - Rule source
input - File from the FileEditorInput
Throws:
org.eclipse.core.runtime.CoreException
Method Detail

getDSLContent

public static Reader getDSLContent(String ruleSource,
                                   org.eclipse.core.resources.IResource input)
                            throws org.eclipse.core.runtime.CoreException
Get a reader to the DSL contents

Throws:
org.eclipse.core.runtime.CoreException

isValid

public boolean isValid()

hasConditions

public boolean hasConditions()

hasConsequences

public boolean hasConsequences()

listConditionItems

public List listConditionItems()

listConsequenceItems

public List listConsequenceItems()

getDSLTree

public DSLTree getDSLTree()


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.