org.drools.lang.api.impl
Class BaseDescrBuilderImpl<P extends DescrBuilder<?,?>,T extends BaseDescr>

java.lang.Object
  extended by org.drools.lang.api.impl.BaseDescrBuilderImpl<P,T>
All Implemented Interfaces:
DescrBuilder<P,T>
Direct Known Subclasses:
AccumulateDescrBuilderImpl, AnnotationDescrBuilderImpl, AttributeDescrBuilderImpl, BehaviorDescrBuilderImpl, CEDescrBuilderImpl, CollectDescrBuilderImpl, DeclareDescrBuilderImpl, EvalDescrBuilderImpl, FieldDescrBuilderImpl, ForallDescrBuilderImpl, FunctionDescrBuilderImpl, GlobalDescrBuilderImpl, ImportDescrBuilderImpl, PackageDescrBuilderImpl, PatternDescrBuilderImpl, QueryDescrBuilderImpl, RuleDescrBuilderImpl, SourceDescrBuilderImpl

public class BaseDescrBuilderImpl<P extends DescrBuilder<?,?>,T extends BaseDescr>
extends Object
implements DescrBuilder<P,T>

A base class for all DescrBuilders


Field Summary
protected  T descr
           
protected  P parent
           
 
Constructor Summary
protected BaseDescrBuilderImpl(P parent, T descr)
           
 
Method Summary
 P end()
          Returns the parent container of this descr builder.
 DescrBuilder<P,T> endCharacter(int offset)
          Sets the offset of the starting character of the corresponding construction in the source file.
 DescrBuilder<P,T> endLocation(int line, int column)
          Sets the end location of the corresponding construction in the source file.
 T getDescr()
          Returns the descriptor generated by this builder.
 DescrBuilder<P,T> startCharacter(int offset)
          Sets the offset of the starting character of the corresponding construction in the source file.
 DescrBuilder<P,T> startLocation(int line, int column)
          Sets the start location of the corresponding construction in the source file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

descr

protected T extends BaseDescr descr

parent

protected P extends DescrBuilder<?,?> parent
Constructor Detail

BaseDescrBuilderImpl

protected BaseDescrBuilderImpl(P parent,
                               T descr)
Method Detail

startLocation

public DescrBuilder<P,T> startLocation(int line,
                                       int column)
Description copied from interface: DescrBuilder
Sets the start location of the corresponding construction in the source file.

Specified by:
startLocation in interface DescrBuilder<P extends DescrBuilder<?,?>,T extends BaseDescr>
Returns:
itself, in order to be used as a fluent API

endLocation

public DescrBuilder<P,T> endLocation(int line,
                                     int column)
Description copied from interface: DescrBuilder
Sets the end location of the corresponding construction in the source file.

Specified by:
endLocation in interface DescrBuilder<P extends DescrBuilder<?,?>,T extends BaseDescr>
Returns:
itself, in order to be used as a fluent API

startCharacter

public DescrBuilder<P,T> startCharacter(int offset)
Description copied from interface: DescrBuilder
Sets the offset of the starting character of the corresponding construction in the source file.

Specified by:
startCharacter in interface DescrBuilder<P extends DescrBuilder<?,?>,T extends BaseDescr>
Parameters:
offset - the offset of the first character of this construction inside the source file, relative to the start.
Returns:
itself, in order to be used as a fluent API

endCharacter

public DescrBuilder<P,T> endCharacter(int offset)
Description copied from interface: DescrBuilder
Sets the offset of the starting character of the corresponding construction in the source file.

Specified by:
endCharacter in interface DescrBuilder<P extends DescrBuilder<?,?>,T extends BaseDescr>
Parameters:
offset - the offset of the first character of this construction inside the source file, relative to the start.
Returns:
itself, in order to be used as a fluent API

getDescr

public T getDescr()
Description copied from interface: DescrBuilder
Returns the descriptor generated by this builder.

Specified by:
getDescr in interface DescrBuilder<P extends DescrBuilder<?,?>,T extends BaseDescr>
Returns:

end

public P end()
Description copied from interface: DescrBuilder
Returns the parent container of this descr builder. Example: ruleDescrBuilder.end() will return the PackageDescrBuilder as that is its parent container.

Specified by:
end in interface DescrBuilder<P extends DescrBuilder<?,?>,T extends BaseDescr>
Returns:


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.