
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.
|
static void |
main(String[] args) |
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, writeSimpleGettercreateFields, finishprotected CssObfuscationStyle obfuscationStyle
public static String getImportPrefix(JClassType importType)
public static void main(String[] args)
public String createAssignment(TreeLogger logger, ResourceContext context, JMethod method) throws UnableToCompleteException
ResourceGeneratorExample:
new MySampleResource() { public Foo getFoo() { ... } }
createAssignment in interface ResourceGeneratorcreateAssignment in class AbstractResourceGeneratorUnableToCompleteExceptionpublic void init(TreeLogger logger, ResourceContext context) throws UnableToCompleteException
AbstractResourceGeneratorinit in interface ResourceGeneratorinit in class AbstractResourceGeneratorUnableToCompleteExceptionpublic void prepare(TreeLogger logger, ResourceContext context, ClientBundleRequirements requirements, JMethod method) throws UnableToCompleteException
AbstractResourceGeneratorprepare in interface ResourceGeneratorprepare in class AbstractResourceGeneratorUnableToCompleteExceptionprotected void checkSheet(TreeLogger logger, CssStylesheet stylesheet) throws UnableToCompleteException
UnableToCompleteExceptionprotected String getBaseclassInterfaceName()
protected String getResourceImplAsString(TreeLogger logger, ResourceContext context, JMethod method, Map<JMethod,String> actualReplacements, JClassType cssResourceSubtype, CssStylesheet stylesheet) throws UnableToCompleteException
UnableToCompleteExceptionprotected URL[] getResources(TreeLogger logger, ResourceContext context, JMethod method) throws UnableToCompleteException
UnableToCompleteExceptionprotected String getSuperclassInterfaceName()
protected void outputAdditionalArtifacts(TreeLogger logger, ResourceContext context, JMethod method, Map<JMethod,String> actualReplacements, JClassType cssResourceSubtype, CssStylesheet stylesheet) throws UnableToCompleteException
UnableToCompleteExceptionprotected 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
UnableToCompleteExceptionprotected String getCssExpression(TreeLogger logger, ResourceContext context, JMethod method) throws UnableToCompleteException
AbstractCssResourceGeneratorgetCssExpression in class AbstractCssResourceGeneratorUnableToCompleteExceptionCopyright © 2018. All rights reserved.