# Class SACParserFactory

java.lang.Object
org.w3c.css.sac.helpers.ParserFactory
org.eclipse.e4.ui.css.core.sac.SACParserFactory

All Implemented Interfaces:
  `ISACParserFactory`

Direct Known Subclasses:
  `SACParserFactoryImpl`

public abstract class SACParserFactory extends org.w3c.css.sac.helpers.ParserFactory implements ISACParserFactory
SAC Parser Factory.

## Constructor Summary

Constructors
Constructor
Description
`SACParserFactory()`

## Method Summary

Modifier and Type
Method
Description
`String`
`getPreferredParserName()`
Return preferred SAC parser name if it is filled and null otherwise.
`org.w3c.css.sac.Parser`
`makeParser()`
Return default instance of SAC Parser.
`abstract org.w3c.css.sac.Parser`
`makeParser(String name)`
Return instance of SAC Parser registered into the factory with name `name`.
`static ISACParserFactory`
`newInstance()`
Return instance of SACParserFactory
`void`
`setPreferredParserName(String preferredParserName)`
Set the preferred SAC parser name to use when makeParser is called.

### Methods inherited from class Object

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

## Constructor Details

### SACParserFactory

public SACParserFactory()

## Method Details

### makeParser

public org.w3c.css.sac.Parser makeParser() throws ClassNotFoundException, IllegalAccessException, InstantiationException, NullPointerException, ClassCastException
Return default instance of SAC Parser. If preferredParserName is filled, it return the instance of SAC Parser registered with this name, otherwise this method search teh SAC Parser class name to instanciate into System property with key org.w3c.css.sac.parser.

Specified by:
  `makeParser` in interface `ISACParserFactory`
Overrides:
  `makeParser` in class `org.w3c.css.sac.helpers.ParserFactory`
Throws:
  `ClassNotFoundException`
  `IllegalAccessException`
  `InstantiationException`
  `NullPointerException`
  `ClassCastException`

### getPreferredParserName

public String getPreferredParserName()
Return preferred SAC parser name if it is filled and null otherwise.

### setPreferredParserName

public void setPreferredParserName(String preferredParserName)
Set the preferred SAC parser name to use when makeParser is called.

### newInstance

public static ISACParserFactory newInstance()
Return instance of SACParserFactory

### makeParser

public abstract org.w3c.css.sac.Parser makeParser(String name) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NullPointerException, ClassCastException
Return instance of SAC Parser registered into the factory with name `name`.

Specified by:
  `makeParser` in interface `ISACParserFactory`
Throws:
  `ClassNotFoundException`
  `IllegalAccessException`
  `InstantiationException`
  `NullPointerException`
  `ClassCastException`