Package com.openhtmltopdf.css.parser
Class CSSParser
java.lang.Object
com.openhtmltopdf.css.parser.CSSParser
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CSSErrorHandlerprivate Lexerprivate Tokenprivate booleanprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddPseudoClassOrElement(Token t, Selector selector) private voidaddPseudoClassOrElementFunction(Token t, Selector selector) private voidaddPseudoElement(Token t, Selector selector) private voidprivate booleancheckCSSName(CSSName cssName, String propertyName) private voidclass_selector(Selector selector) private Tokenprivate intconvertToInteger(char hexchar1) private intconvertToInteger(char hexchar1, char hexchar2) private FSCMYKColorcreateCMYKColorFromFunction(List<PropertyValue> params) private FSRGBColorcreateRGBColorFromFunction(List<PropertyValue> params) private voiddeclaration(Ruleset ruleset, boolean inFontFace) private voiddeclaration_list(Ruleset ruleset, boolean expectEOF, boolean expectAtRule, boolean inFontFace) private voiderror(CSSParseException e, String what, boolean rethrowEOF) private List<PropertyValue> expr(boolean literal) private Stringprivate StringextractUnit(Token t) private voidfont_face(Stylesheet stylesheet) private PropertyValuefunction()private intprivate Stringprivate Stringprivate StringgetTokenValue(Token t, boolean literal) private PropertyValuehexcolor()private voidimport_rule(Stylesheet stylesheet) private static booleanisHexChar(char c) private booleanbooleanprivate Tokenla()private voidmargin(Stylesheet stylesheet, PageRule pageRule) private voidmedia(Stylesheet stylesheet) private Stringmedium()private SelectormergeSimpleSelectors(List<Selector> selectors, List<Token> combinators) private voidprivate Tokennext()private voidoperator()private voidpage(Stylesheet stylesheet) private floatparseCMYKColorComponent(PropertyValue value, int paramNo) parseDeclaration(int origin, String text) parsePropertyValue(CSSName cssName, int origin, String expr) parseStylesheet(String uri, int origin, Reader reader) private voidprio()private static StringprocessEscapes(char[] ch, int start, int end) private Stringproperty()private voidprivate Stringprivate voidprivate voidrecover(boolean needBlock, boolean stopBeforeBlockClose) voidprivate voidruleset(RulesetContainer container) private voidvoidsetErrorHandler(CSSErrorHandler errorHandler) voidsetSupportCMYKColors(boolean b) private Stringsign(float sign) private Selectorsimple_selector(Ruleset ruleset) private voidprivate voidprivate voidstylesheet(Stylesheet stylesheet) private PropertyValueterm(boolean literal) private CSSParser.NamespacePairtyped_value(boolean matchAttribute) private int
-
Field Details
-
SUPPORTED_PSEUDO_ELEMENTS
-
CSS21_PSEUDO_ELEMENTS
-
_saved
-
_lexer
-
_errorHandler
-
_URI
-
_namespaces
-
_supportCMYKColors
private boolean _supportCMYKColors
-
-
Constructor Details
-
CSSParser
-
-
Method Details
-
parseStylesheet
- Throws:
IOException
-
parseDeclaration
-
parsePropertyValue
-
stylesheet
- Throws:
IOException
-
import_rule
- Throws:
IOException
-
namespace
- Throws:
IOException
-
media
- Throws:
IOException
-
medium
- Throws:
IOException
-
font_face
- Throws:
IOException
-
page
- Throws:
IOException
-
margin
- Throws:
IOException
-
pseudo_page
- Throws:
IOException
-
operator
- Throws:
IOException
-
combinator
- Throws:
IOException
-
unary_operator
- Throws:
IOException
-
property
- Throws:
IOException
-
declaration_list
private void declaration_list(Ruleset ruleset, boolean expectEOF, boolean expectAtRule, boolean inFontFace) throws IOException - Throws:
IOException
-
ruleset
- Throws:
IOException
-
selector
- Throws:
IOException
-
mergeSimpleSelectors
-
simple_selector
- Throws:
IOException
-
typed_value
- Throws:
IOException
-
class_selector
- Throws:
IOException
-
attrib
- Throws:
IOException
-
addPseudoClassOrElement
-
addPseudoClassOrElementFunction
- Throws:
IOException
-
addPseudoElement
-
pseudo
- Throws:
IOException
-
checkCSSName
-
declaration
- Throws:
IOException
-
prio
- Throws:
IOException
-
expr
- Throws:
IOException
-
extractNumber
-
extractUnit
-
sign
-
term
- Throws:
IOException
-
function
- Throws:
IOException
-
createCMYKColorFromFunction
-
parseCMYKColorComponent
-
createRGBColorFromFunction
-
hexcolor
- Throws:
IOException
-
isHexString
-
convertToInteger
private int convertToInteger(char hexchar1, char hexchar2) -
convertToInteger
private int convertToInteger(char hexchar1) -
skip_whitespace
- Throws:
IOException
-
skip_whitespace_and_cdocdc
- Throws:
IOException
-
next
- Throws:
IOException
-
push
-
la
- Throws:
IOException
-
error
-
recover
- Throws:
IOException
-
reset
-
getErrorHandler
-
setErrorHandler
-
getRawTokenValue
-
getTokenValue
-
getTokenValue
-
getCurrentLine
private int getCurrentLine() -
isHexChar
private static boolean isHexChar(char c) -
processEscapes
-
isSupportCMYKColors
public boolean isSupportCMYKColors() -
setSupportCMYKColors
public void setSupportCMYKColors(boolean b)
-