Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sourceforge.pmd
Class RuleContext

    java.lang.Object
      net.sourceforge.pmd.RuleContext

    public class RuleContext

extends java.lang.Object

Constructor Summary
`RuleContext()` Default constructor.
`RuleContext(RuleContext ruleContext)` Constructor which shares attributes with the given RuleContext.

Method Summary
`void` | `excludeLines(java.util.Map<java.lang.Integer,java.lang.String> lines)`
`java.lang.Object` | `getAttribute(java.lang.String name)` Get an attribute value on the RuleContext.
`Report` | `getReport()`
`java.io.File` | `getSourceCodeFile()`
`java.lang.String` | `getSourceCodeFilename()`
`SourceType` | `getSourceType()`
`java.lang.Object` | `removeAttribute(java.lang.String name)` Remove an attribute value on the RuleContext.
`boolean` | `setAttribute(java.lang.String name, java.lang.Object value)` Set an attribute value on the RuleContext, if it does not already exist.
`void` | `setReport(Report report)`
`void` | `setSourceCodeFile(java.io.File sourceCodeFile)`
`void` | `setSourceCodeFilename(java.lang.String filename)`
`void` | `setSourceType(SourceType t)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RuleContext

    public RuleContext()

  Default constructor.

### RuleContext

    public RuleContext(RuleContext ruleContext)

  Constructor which shares attributes with the given RuleContext.

Method Detail

### getReport

    public Report getReport()

### setReport

    public void setReport(Report report)

### getSourceCodeFile

    public java.io.File getSourceCodeFile()

### setSourceCodeFile

    public void setSourceCodeFile(java.io.File sourceCodeFile)

### getSourceCodeFilename

    public java.lang.String getSourceCodeFilename()

### setSourceCodeFilename

    public void setSourceCodeFilename(java.lang.String filename)

### excludeLines

    public void excludeLines(java.util.Map<java.lang.Integer,java.lang.String> lines)

### getSourceType

    public SourceType getSourceType()

### setSourceType

    public void setSourceType(SourceType t)

### setAttribute

    public boolean setAttribute(java.lang.String name,
                                java.lang.Object value)

  Set an attribute value on the RuleContext, if it does not already exist.

  Attributes can be shared between RuleContext instances. This operation is thread-safe.

  Attribute values should be modified directly via the reference provided. It is not necessary to call `setAttribute(String, Object)` to update an attribute value. Modifications made to the attribute value will automatically be seen by other threads. Because of this, you must ensure the attribute values are themselves thread safe.

  Parameters:
    `name` - The attribute name.
    `value` - The attribute value.
  Returns:
    `true` if the attribute was set, `false` otherwise.
  Throws:
    `java.lang.IllegalArgumentException` - if `name` or `value` are `null`

### getAttribute

    public java.lang.Object getAttribute(java.lang.String name)

  Get an attribute value on the RuleContext.

  Attributes can be shared between RuleContext instances. This operation is thread-safe.

  Attribute values should be modified directly via the reference provided. It is not necessary to call `setAttribute(String, Object)` to update an attribute value. Modifications made to the attribute value will automatically be seen by other threads. Because of this, you must ensure the attribute values are themselves thread safe.

  Parameters:
    `name` - The attribute name.
  Returns:
    The current attribute value, or `null` if the attribute does not exist.

### removeAttribute

    public java.lang.Object removeAttribute(java.lang.String name)

  Remove an attribute value on the RuleContext.

  Attributes can be shared between RuleContext instances. This operation is thread-safe.

  Attribute values should be modified directly via the reference provided. It is not necessary to call `setAttribute(String, Object)` to update an attribute value. Modifications made to the attribute value will automatically be seen by other threads. Because of this, you must ensure the attribute values are themselves thread safe.

  Parameters:
    `name` - The attribute name.
  Returns:
    The current attribute value, or `null` if the attribute does not exist.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2009 InfoEther. All Rights Reserved.