Top Inners Fields Constructors Methods
com.openhtmltopdf.css.parser

public Class CSSParser

extends Object
Class Inheritance
Imports
com.openhtmltopdf.css.constants.CSSName, .MarginBoxName, .SVGProperty, com.openhtmltopdf.css.extend.TreeResolver, com.openhtmltopdf.css.newmatch.Selector, com.openhtmltopdf.css.parser.property.PropertyBuilder, com.openhtmltopdf.css.sheet.*, com.openhtmltopdf.util.LogMessageId, .ThreadCtx, .XRLog, java.io.IOException, .Reader, .StringReader, java.util.*, java.util.logging.Level

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private CSSErrorHandler
private Lexer
private Map<String, String>
private Token
private boolean
private String
private static final Set<String>
private static final Set<String>

Constructor Summary

AccessConstructor and Description
public
CSSParser(CSSErrorHandler errorHandler)

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
private void
attrib(Selector selector)

private boolean
checkCSSName(CSSName cssName, String propertyName)

private void
private Token
private int
convertToInteger(char hexchar1, char hexchar2)

private int
convertToInteger(char hexchar1)

private FSCMYKColor
private FSRGBColor
private void
declaration(Ruleset ruleset, boolean inFontFace)

private void
declaration_list(Ruleset ruleset, boolean expectEOF, boolean expectAtRule, boolean inFontFace)

private void
error(CSSParseException e, String what, boolean rethrowEOF)

private List<PropertyValue>
expr(boolean literal)

private String
private String
private void
font_face(Stylesheet stylesheet)

private PropertyValue
private int
public CSSErrorHandler
private String
private String
private String
getTokenValue(Token t, boolean literal)

private PropertyValue
private void
import_rule(Stylesheet stylesheet)

private static boolean
isHexChar(char c)

private boolean
public boolean
private Token
la()

private void
margin(Stylesheet stylesheet, PageRule pageRule)

private void
media(Stylesheet stylesheet)

private String
private Selector
mergeSimpleSelectors(List<Selector> selectors, List<Token> combinators)

private void
private Token
next()

private void
private void
page(Stylesheet stylesheet)

private float
public Ruleset
parseDeclaration(int origin, String text)

public PropertyValue
parsePropertyValue(CSSName cssName, int origin, String expr)

public Stylesheet
parseStylesheet(String uri, int origin, Reader reader)

private void
prio()

private static String
processEscapes(char[] ch, int start, int end)

private String
private void
pseudo(Selector selector)

private String
private void
private void
recover(boolean needBlock, boolean stopBeforeBlockClose)

public void
private void
private void
selector(Ruleset ruleset)

public void
public void
private String
sign(float sign)

private Selector
private void
private void
private void
stylesheet(Stylesheet stylesheet)

private PropertyValue
term(boolean literal)

private CSSParser.NamespacePair
typed_value(boolean matchAttribute)

private int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_errorHandlerback to summary
private CSSErrorHandler _errorHandler
_lexerback to summary
private Lexer _lexer
_namespacesback to summary
private Map<String, String> _namespaces
_savedback to summary
private Token _saved
_supportCMYKColorsback to summary
private boolean _supportCMYKColors
_URIback to summary
private String _URI
CSS21_PSEUDO_ELEMENTSback to summary
private static final Set<String> CSS21_PSEUDO_ELEMENTS
SUPPORTED_PSEUDO_ELEMENTSback to summary
private static final Set<String> SUPPORTED_PSEUDO_ELEMENTS

Constructor Detail

CSSParserback to summary
public CSSParser(CSSErrorHandler errorHandler)

Method Detail

addPseudoClassOrElementback to summary
private void addPseudoClassOrElement(Token t, Selector selector)
addPseudoClassOrElementFunctionback to summary
private void addPseudoClassOrElementFunction(Token t, Selector selector) throws IOException
addPseudoElementback to summary
private void addPseudoElement(Token t, Selector selector)
attribback to summary
private void attrib(Selector selector) throws IOException
checkCSSNameback to summary
private boolean checkCSSName(CSSName cssName, String propertyName)
class_selectorback to summary
private void class_selector(Selector selector) throws IOException
combinatorback to summary
private Token combinator() throws IOException
convertToIntegerback to summary
private int convertToInteger(char hexchar1, char hexchar2)
convertToIntegerback to summary
private int convertToInteger(char hexchar1)
createCMYKColorFromFunctionback to summary
private FSCMYKColor createCMYKColorFromFunction(List<PropertyValue> params)
createRGBColorFromFunctionback to summary
private FSRGBColor createRGBColorFromFunction(List<PropertyValue> params)
declarationback to summary
private void declaration(Ruleset ruleset, boolean inFontFace) throws IOException
declaration_listback to summary
private void declaration_list(Ruleset ruleset, boolean expectEOF, boolean expectAtRule, boolean inFontFace) throws IOException
errorback to summary
private void error(CSSParseException e, String what, boolean rethrowEOF)
exprback to summary
private List<PropertyValue> expr(boolean literal) throws IOException
extractNumberback to summary
private String extractNumber(Token t)
extractUnitback to summary
private String extractUnit(Token t)
font_faceback to summary
private void font_face(Stylesheet stylesheet) throws IOException
functionback to summary
private PropertyValue function() throws IOException
getCurrentLineback to summary
private int getCurrentLine()
getErrorHandlerback to summary
public CSSErrorHandler getErrorHandler()
getRawTokenValueback to summary
private String getRawTokenValue()
getTokenValueback to summary
private String getTokenValue(Token t)
getTokenValueback to summary
private String getTokenValue(Token t, boolean literal)
hexcolorback to summary
private PropertyValue hexcolor() throws IOException
import_ruleback to summary
private void import_rule(Stylesheet stylesheet) throws IOException
isHexCharback to summary
private static boolean isHexChar(char c)
isHexStringback to summary
private boolean isHexString(String s)
isSupportCMYKColorsback to summary
public boolean isSupportCMYKColors()
laback to summary
private Token la() throws IOException
marginback to summary
private void margin(Stylesheet stylesheet, PageRule pageRule) throws IOException
mediaback to summary
private void media(Stylesheet stylesheet) throws IOException
mediumback to summary
private String medium() throws IOException
mergeSimpleSelectorsback to summary
private Selector mergeSimpleSelectors(List<Selector> selectors, List<Token> combinators)
namespaceback to summary
private void namespace() throws IOException
nextback to summary
private Token next() throws IOException
operatorback to summary
private void operator() throws IOException
pageback to summary
private void page(Stylesheet stylesheet) throws IOException
parseCMYKColorComponentback to summary
private float parseCMYKColorComponent(PropertyValue value, int paramNo)
parseDeclarationback to summary
public Ruleset parseDeclaration(int origin, String text)
parsePropertyValueback to summary
public PropertyValue parsePropertyValue(CSSName cssName, int origin, String expr)
parseStylesheetback to summary
public Stylesheet parseStylesheet(String uri, int origin, Reader reader) throws IOException
prioback to summary
private void prio() throws IOException
processEscapesback to summary
private static String processEscapes(char[] ch, int start, int end)
propertyback to summary
private String property() throws IOException
pseudoback to summary
private void pseudo(Selector selector) throws IOException
pseudo_pageback to summary
private String pseudo_page() throws IOException
pushback to summary
private void push(Token t)
recoverback to summary
private void recover(boolean needBlock, boolean stopBeforeBlockClose) throws IOException
resetback to summary
public void reset(Reader r)
rulesetback to summary
private void ruleset(RulesetContainer container) throws IOException
selectorback to summary
private void selector(Ruleset ruleset) throws IOException
setErrorHandlerback to summary
public void setErrorHandler(CSSErrorHandler errorHandler)
setSupportCMYKColorsback to summary
public void setSupportCMYKColors(boolean b)
signback to summary
private String sign(float sign)
simple_selectorback to summary
private Selector simple_selector(Ruleset ruleset) throws IOException
skip_whitespaceback to summary
private void skip_whitespace() throws IOException
skip_whitespace_and_cdocdcback to summary
private void skip_whitespace_and_cdocdc() throws IOException
stylesheetback to summary
private void stylesheet(Stylesheet stylesheet) throws IOException
termback to summary
private PropertyValue term(boolean literal) throws IOException
typed_valueback to summary
private CSSParser.NamespacePair typed_value(boolean matchAttribute) throws IOException
unary_operatorback to summary
private int unary_operator() throws IOException
com.openhtmltopdf.css.parser back to summary

private Class CSSParser.NamespacePair

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
NamespacePair(String namespaceURI, String name)

Method Summary

Modifier and TypeMethod and Description
public String
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_nameback to summary
private final String _name
_namespaceURIback to summary
private final String _namespaceURI

Constructor Detail

NamespacePairback to summary
public NamespacePair(String namespaceURI, String name)

Method Detail

getNameback to summary
public String getName()
getNamespaceURIback to summary
public String getNamespaceURI()