public class CssResourceGenerator extends AbstractCssResourceGenerator implements SupportsGeneratorResultCaching
Modifier and Type | Field and Description |
---|---|
protected CssObfuscationStyle |
obfuscationStyle |
STRIP_COMMENTS
Constructor and Description |
---|
CssResourceGenerator() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkSheet(TreeLogger logger,
CssStylesheet stylesheet) |
String |
createAssignment(TreeLogger logger,
ResourceContext context,
JMethod method)
Produce the right-hand-side of a Java assignment expression to provide the
singleton instance object for a particular resource.
|
protected String |
getBaseclassInterfaceName()
Return the name of the class which is at the base of the CssResource
generation tree.
|
protected String |
getCssExpression(TreeLogger logger,
ResourceContext context,
JMethod method)
Returns the java expression that contains the compiled CSS.
|
static String |
getImportPrefix(JClassType importType)
Returns the import prefix for a type, including the trailing hyphen.
|
protected String |
getResourceImplAsString(TreeLogger logger,
ResourceContext context,
JMethod method,
Map<JMethod,String> actualReplacements,
JClassType cssResourceSubtype,
CssStylesheet stylesheet) |
protected URL[] |
getResources(TreeLogger logger,
ResourceContext context,
JMethod method) |
protected String |
getSuperclassInterfaceName()
Return the name of the class which is the direct superclass of the
interface being implemented.
|
static boolean |
haveCommonProperties(CssRule a,
CssRule b) |
void |
init(TreeLogger logger,
ResourceContext context)
A no-op implementation.
|
protected void |
outputAdditionalArtifacts(TreeLogger logger,
ResourceContext context,
JMethod method,
Map<JMethod,String> actualReplacements,
JClassType cssResourceSubtype,
CssStylesheet stylesheet)
Output additional artifacts.
|
protected void |
outputCssMapArtifact(TreeLogger logger,
ResourceContext context,
JMethod method,
Map<JMethod,String> actualReplacements)
Builds a CSV file mapping obfuscated CSS class names to their qualified source name and
outputs it as a private build artifact.
|
void |
prepare(TreeLogger logger,
ResourceContext context,
ClientBundleRequirements requirements,
JMethod method)
A no-op implementation.
|
protected void |
writeUserMethods(TreeLogger logger,
com.google.gwt.user.rebind.SourceWriter sw,
CssStylesheet sheet,
JMethod[] methods,
Map<JMethod,String> obfuscatedClassNames)
Write all of the user-defined methods in the CssResource subtype.
|
isReturnTypeString, writeEnsureInjected, writeGetName, writeGetText, writeSimpleGetter
createFields, finish
protected CssObfuscationStyle obfuscationStyle
public static String getImportPrefix(JClassType importType)
public String createAssignment(TreeLogger logger, ResourceContext context, JMethod method) throws UnableToCompleteException
ResourceGenerator
Example:
new MySampleResource() { public Foo getFoo() { ... } }
createAssignment
in interface ResourceGenerator
createAssignment
in class AbstractResourceGenerator
UnableToCompleteException
public void init(TreeLogger logger, ResourceContext context) throws UnableToCompleteException
AbstractResourceGenerator
init
in interface ResourceGenerator
init
in class AbstractResourceGenerator
UnableToCompleteException
public void prepare(TreeLogger logger, ResourceContext context, ClientBundleRequirements requirements, JMethod method) throws UnableToCompleteException
AbstractResourceGenerator
prepare
in interface ResourceGenerator
prepare
in class AbstractResourceGenerator
UnableToCompleteException
protected void checkSheet(TreeLogger logger, CssStylesheet stylesheet) throws UnableToCompleteException
UnableToCompleteException
protected String getBaseclassInterfaceName()
protected String getResourceImplAsString(TreeLogger logger, ResourceContext context, JMethod method, Map<JMethod,String> actualReplacements, JClassType cssResourceSubtype, CssStylesheet stylesheet) throws UnableToCompleteException
UnableToCompleteException
protected URL[] getResources(TreeLogger logger, ResourceContext context, JMethod method) throws UnableToCompleteException
UnableToCompleteException
protected String getSuperclassInterfaceName()
protected void outputAdditionalArtifacts(TreeLogger logger, ResourceContext context, JMethod method, Map<JMethod,String> actualReplacements, JClassType cssResourceSubtype, CssStylesheet stylesheet) throws UnableToCompleteException
UnableToCompleteException
protected void outputCssMapArtifact(TreeLogger logger, ResourceContext context, JMethod method, Map<JMethod,String> actualReplacements)
protected void writeUserMethods(TreeLogger logger, com.google.gwt.user.rebind.SourceWriter sw, CssStylesheet sheet, JMethod[] methods, Map<JMethod,String> obfuscatedClassNames) throws UnableToCompleteException
UnableToCompleteException
protected String getCssExpression(TreeLogger logger, ResourceContext context, JMethod method) throws UnableToCompleteException
AbstractCssResourceGenerator
getCssExpression
in class AbstractCssResourceGenerator
UnableToCompleteException
Copyright © 2018. All rights reserved.