use of com.gargoylesoftware.css.parser.CSSParseException in project LoboEvolution by LoboEvolution.
the class MediaListImpl method setMediaText.
/**
* Parses the given media text.
*
* @param mediaText text to be parsed
* @throws org.w3c.dom.DOMException in case of error
*/
public void setMediaText(final String mediaText) throws DOMException {
try {
final CSSOMParser parser = new CSSOMParser();
parser.setErrorHandler(ThrowCssExceptionErrorHandler.INSTANCE);
final MediaQueryList sml = parser.parseMedia(mediaText);
setMediaList(sml);
} catch (final CSSParseException e) {
throw new DOMException(DOMException.SYNTAX_ERR, e.getLocalizedMessage());
} catch (final IOException e) {
throw new DOMException(DOMException.NOT_FOUND_ERR, e.getLocalizedMessage());
}
}
Aggregations