Package org.eclipse.m2m.atl.adt.ui.text

# Class AbstractScanner

java.lang.Object
org.eclipse.jface.text.rules.RuleBasedScanner
org.eclipse.m2m.atl.adt.ui.text.AbstractScanner

All Implemented Interfaces:
  `org.eclipse.jface.text.rules.ICharacterScanner`, `org.eclipse.jface.text.rules.ITokenScanner`

Direct Known Subclasses:
  `AtlCodeScanner`

public abstract class AbstractScanner extends org.eclipse.jface.text.rules.RuleBasedScanner
Its subclasses are only responsible for providing a list of preference keys based on which tokens are generated and to use this tokens to define the rules controlling this scanner.

## Field Summary

### Fields inherited from class org.eclipse.jface.text.rules.RuleBasedScanner

`fColumn, fDefaultReturnToken, fDelimiters, fDocument, fOffset, fRangeEnd, fRules, fTokenOffset, UNDEFINED`

### Fields inherited from interface org.eclipse.jface.text.rules.ICharacterScanner

`EOF`

## Constructor Summary

Constructors
Constructor
Description
`AbstractScanner(AtlTextTools texttools)`
Creates an abstract ATL scanner.

## Method Summary

Modifier and Type
Method
Description
`void`
`adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event)`
`boolean`
`affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event)`
`protected abstract List`
`createRules()`
Creates the list of rules controlling this scanner.
`protected abstract String[]`
`getPropertyNames()`
Returns a list of constants matching the token.
`protected AtlTextTools`
`getTextTools()`
`protected org.eclipse.jface.text.rules.Token`
`getToken(String color)`
Return the token matching the color value.
`final void`
`initialize()`
Must be called after the constructor has been called.

### Methods inherited from class org.eclipse.jface.text.rules.RuleBasedScanner

`getColumn, getLegalLineDelimiters, getTokenLength, getTokenOffset, nextToken, read, setDefaultReturnToken, setRange, setRules, unread`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AbstractScanner

public AbstractScanner(AtlTextTools texttools)
Creates an abstract ATL scanner. This needs to create firstable the tokens style, and afterwards associate them to their token value.

## Method Details

### adaptToPreferenceChange

public void adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event)

### affectsBehavior

public boolean affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event)

### createRules

protected abstract List createRules()
Creates the list of rules controlling this scanner.

Returns:
  the list of rules

### getPropertyNames

protected abstract String[] getPropertyNames()
Returns a list of constants matching the token.

Returns:
  the list of constants

### getTextTools

protected AtlTextTools getTextTools()

### getToken

protected org.eclipse.jface.text.rules.Token getToken(String color)
Return the token matching the color value.

Parameters:
  `color` - the color name of the key
Returns:
  the fetching token

### initialize

public final void initialize()
Must be called after the constructor has been called.