@Immutable public final class CSSReaderDeclarationList extends Object
<style> attributes only.| Modifier and Type | Method and Description |
|---|---|
static ICSSInterpretErrorHandler |
getDefaultInterpretErrorHandler() |
static ICSSParseErrorHandler |
getDefaultParseErrorHandler() |
static ICSSParseExceptionCallback |
getDefaultParseExceptionHandler() |
static boolean |
isValidCSS(File aFile,
Charset aCharset,
ECSSVersion eVersion)
Check if the passed CSS file can be parsed without error
|
static boolean |
isValidCSS(InputStream aIS,
Charset aCharset,
ECSSVersion eVersion)
Check if the passed input stream can be resembled to valid CSS content.
|
static boolean |
isValidCSS(com.helger.commons.io.resource.IReadableResource aRes,
Charset aCharset,
ECSSVersion eVersion)
Check if the passed CSS resource can be parsed without error
|
static boolean |
isValidCSS(Reader aReader,
ECSSVersion eVersion)
Check if the passed reader can be resembled to valid CSS content.
|
static boolean |
isValidCSS(String sCSS,
ECSSVersion eVersion)
Check if the passed String can be resembled to valid CSS content.
|
static CSSDeclarationList |
readFromFile(File aFile,
Charset aCharset,
ECSSVersion eVersion) |
static CSSDeclarationList |
readFromFile(File aFile,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler) |
static CSSDeclarationList |
readFromFile(File aFile,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler,
ICSSParseExceptionCallback aCustomExceptionHandler) |
static CSSDeclarationList |
readFromFile(File aFile,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseExceptionCallback aCustomExceptionHandler) |
static CSSDeclarationList |
readFromReader(Reader aReader,
CSSReaderSettings aSettings)
Read the CSS from the passed
Reader. |
static CSSDeclarationList |
readFromReader(Reader aReader,
ECSSVersion eVersion)
Read the CSS from the passed
Reader. |
static CSSDeclarationList |
readFromReader(Reader aReader,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler)
Read the CSS from the passed
Reader. |
static CSSDeclarationList |
readFromReader(Reader aReader,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler,
ICSSParseExceptionCallback aCustomExceptionHandler)
Read the CSS from the passed
Reader. |
static CSSDeclarationList |
readFromReader(Reader aReader,
ECSSVersion eVersion,
ICSSParseExceptionCallback aCustomExceptionHandler)
Read the CSS from the passed
Reader. |
static CSSDeclarationList |
readFromStream(com.helger.commons.io.IHasInputStream aISP,
Charset aCharset,
ECSSVersion eVersion)
Read the CSS from the passed
IHasInputStream. |
static CSSDeclarationList |
readFromStream(com.helger.commons.io.IHasInputStream aISP,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler)
Read the CSS from the passed
IHasInputStream. |
static CSSDeclarationList |
readFromStream(com.helger.commons.io.IHasInputStream aISP,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler,
ICSSParseExceptionCallback aCustomExceptionHandler)
Read the CSS from the passed
IHasInputStream. |
static CSSDeclarationList |
readFromStream(com.helger.commons.io.IHasInputStream aISP,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseExceptionCallback aCustomExceptionHandler)
Read the CSS from the passed
IHasInputStream. |
static CSSDeclarationList |
readFromStream(InputStream aIS,
Charset aCharset,
ECSSVersion eVersion)
Read the CSS from the passed
InputStream. |
static CSSDeclarationList |
readFromStream(InputStream aIS,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler)
Read the CSS from the passed
InputStream. |
static CSSDeclarationList |
readFromStream(InputStream aIS,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler,
ICSSParseExceptionCallback aCustomExceptionHandler)
Read the CSS from the passed
InputStream. |
static CSSDeclarationList |
readFromStream(InputStream aIS,
Charset aCharset,
ECSSVersion eVersion,
ICSSParseExceptionCallback aCustomExceptionHandler)
Read the CSS from the passed
InputStream. |
static CSSDeclarationList |
readFromString(String sCSS,
ECSSVersion eVersion) |
static CSSDeclarationList |
readFromString(String sCSS,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler) |
static CSSDeclarationList |
readFromString(String sCSS,
ECSSVersion eVersion,
ICSSParseErrorHandler aCustomErrorHandler,
ICSSParseExceptionCallback aCustomExceptionHandler) |
static CSSDeclarationList |
readFromString(String sCSS,
ECSSVersion eVersion,
ICSSParseExceptionCallback aCustomExceptionHandler) |
static void |
setDefaultInterpretErrorHandler(ICSSInterpretErrorHandler aDefaultErrorHandler)
Set the default interpret error handler to handle interpretation errors in
successfully parsed CSS.
|
static void |
setDefaultParseErrorHandler(ICSSParseErrorHandler aDefaultParseErrorHandler)
Set the default CSS parse error handler (for recoverable errors).
|
static void |
setDefaultParseExceptionHandler(ICSSParseExceptionCallback aDefaultParseExceptionHandler)
Set the default CSS parse exception handler (for unrecoverable errors).
|
@Nullable public static ICSSParseErrorHandler getDefaultParseErrorHandler()
null. For
backwards compatibility reasons this is be default an instance of
ThrowingCSSParseErrorHandler.public static void setDefaultParseErrorHandler(@Nullable ICSSParseErrorHandler aDefaultParseErrorHandler)
aDefaultParseErrorHandler - The new default error handler to be used. May be null
to indicate that no special error handler should be used.@Nonnull public static ICSSParseExceptionCallback getDefaultParseExceptionHandler()
null. For backwards compatibility reasons this is be
default an instance of LoggingCSSParseExceptionCallback.public static void setDefaultParseExceptionHandler(@Nonnull ICSSParseExceptionCallback aDefaultParseExceptionHandler)
aDefaultParseExceptionHandler - The new default exception handler to be used. May not be
null.@Nonnull public static ICSSInterpretErrorHandler getDefaultInterpretErrorHandler()
null.public static void setDefaultInterpretErrorHandler(@Nonnull ICSSInterpretErrorHandler aDefaultErrorHandler)
aDefaultErrorHandler - The default error handler to be used. May not be null.public static boolean isValidCSS(@Nonnull File aFile, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion)
aFile - The file to be parsed. May not be null.aCharset - The charset to be used for reading the CSS file. May not be
null.eVersion - The CSS version to be used for scanning. May not be
null.true if the file can be parsed without error,
false if notpublic static boolean isValidCSS(@Nonnull com.helger.commons.io.resource.IReadableResource aRes, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion)
aRes - The resource to be parsed. May not be null.aCharset - The charset to be used for reading the CSS file. May not be
null.eVersion - The CSS version to be used for scanning. May not be
null.true if the file can be parsed without error,
false if notpublic static boolean isValidCSS(@Nonnull @WillClose InputStream aIS, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion)
readFromStream(IHasInputStream,Charset, ECSSVersion) and checking
for a non-null result.aIS - The input stream to use. Is automatically closed. May not be
null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.true if the CSS is valid according to the version,
false if notpublic static boolean isValidCSS(@Nonnull String sCSS, @Nonnull ECSSVersion eVersion)
readFromString(String, ECSSVersion) and
checking for a non-null result.sCSS - The CSS string to scan. May not be null.eVersion - The CSS version to use. May not be null.true if the CSS is valid according to the version,
false if notpublic static boolean isValidCSS(@Nonnull @WillClose Reader aReader, @Nonnull ECSSVersion eVersion)
readFromStream(IHasInputStream, Charset, ECSSVersion) and checking
for a non-null result.aReader - The reader to use. May not be null.eVersion - The CSS version to use. May not be null.true if the CSS is valid according to the version,
false if not@Nullable public static CSSDeclarationList readFromString(@Nonnull String sCSS, @Nonnull ECSSVersion eVersion)
@Nullable public static CSSDeclarationList readFromString(@Nonnull String sCSS, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler)
@Nullable public static CSSDeclarationList readFromString(@Nonnull String sCSS, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
@Nullable public static CSSDeclarationList readFromString(@Nonnull String sCSS, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
@Nullable public static CSSDeclarationList readFromFile(@Nonnull File aFile, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion)
@Nullable public static CSSDeclarationList readFromFile(@Nonnull File aFile, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler)
@Nullable public static CSSDeclarationList readFromFile(@Nonnull File aFile, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
@Nullable public static CSSDeclarationList readFromFile(@Nonnull File aFile, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
@Nullable public static CSSDeclarationList readFromStream(@Nonnull com.helger.commons.io.IHasInputStream aISP, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion)
IHasInputStream.aISP - The input stream provider to use. May not be null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromStream(@Nonnull com.helger.commons.io.IHasInputStream aISP, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler)
IHasInputStream.aISP - The input stream provider to use. May not be null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.aCustomErrorHandler - An optional custom error handler that can be used to collect the
recoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromStream(@Nonnull com.helger.commons.io.IHasInputStream aISP, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
IHasInputStream.aISP - The input stream provider to use. May not be null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.aCustomExceptionHandler - An optional custom exception handler that can be used to collect the
unrecoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromStream(@Nonnull com.helger.commons.io.IHasInputStream aISP, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
IHasInputStream.aISP - The input stream provider to use. May not be null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.aCustomErrorHandler - An optional custom error handler that can be used to collect the
recoverable parsing errors. May be null.aCustomExceptionHandler - An optional custom exception handler that can be used to collect the
unrecoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromStream(@Nonnull @WillClose InputStream aIS, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion)
InputStream.aIS - The input stream to use. Will be closed automatically after reading
- independent of success or error. May not be null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromStream(@Nonnull @WillClose InputStream aIS, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler)
InputStream.aIS - The input stream to use. Will be closed automatically after reading
- independent of success or error. May not be null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.aCustomErrorHandler - An optional custom error handler that can be used to collect the
recoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromStream(@Nonnull @WillClose InputStream aIS, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
InputStream.aIS - The input stream to use. Will be closed automatically after reading
- independent of success or error. May not be null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.aCustomExceptionHandler - An optional custom exception handler that can be used to collect the
unrecoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromStream(@Nonnull @WillClose InputStream aIS, @Nonnull Charset aCharset, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
InputStream.aIS - The input stream to use. Will be closed automatically after reading
- independent of success or error. May not be null.aCharset - The charset to be used. May not be null.eVersion - The CSS version to use. May not be null.aCustomErrorHandler - An optional custom error handler that can be used to collect the
recoverable parsing errors. May be null.aCustomExceptionHandler - An optional custom exception handler that can be used to collect the
unrecoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromReader(@Nonnull @WillClose Reader aReader, @Nonnull ECSSVersion eVersion)
Reader.aReader - The reader to use. Will be closed automatically after reading -
independent of success or error. May not be null.eVersion - The CSS version to use. May not be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromReader(@Nonnull @WillClose Reader aReader, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler)
Reader.aReader - The reader to use. Will be closed automatically after reading -
independent of success or error. May not be null.eVersion - The CSS version to use. May not be null.aCustomErrorHandler - An optional custom error handler that can be used to collect the
recoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromReader(@Nonnull @WillClose Reader aReader, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
Reader.aReader - The reader to use. Will be closed automatically after reading -
independent of success or error. May not be null.eVersion - The CSS version to use. May not be null.aCustomExceptionHandler - An optional custom exception handler that can be used to collect the
unrecoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromReader(@Nonnull @WillClose Reader aReader, @Nonnull ECSSVersion eVersion, @Nullable ICSSParseErrorHandler aCustomErrorHandler, @Nullable ICSSParseExceptionCallback aCustomExceptionHandler)
Reader.aReader - The reader to use. Will be closed automatically after reading -
independent of success or error. May not be null.eVersion - The CSS version to use. May not be null.aCustomErrorHandler - An optional custom error handler that can be used to collect the
recoverable parsing errors. May be null.aCustomExceptionHandler - An optional custom exception handler that can be used to collect the
unrecoverable parsing errors. May be null.null if reading failed, the CSS declarations
otherwise.@Nullable public static CSSDeclarationList readFromReader(@Nonnull @WillClose Reader aReader, @Nonnull CSSReaderSettings aSettings)
Reader.aReader - The reader to use. Will be closed automatically after reading -
independent of success or error. May not be null.aSettings - The settings to be used for reading the CSS. May not be
null.null if reading failed, the CSS declarations
otherwise.Copyright © 2014–2018 Philip Helger. All rights reserved.