public abstract class AbstractResourceWriter extends ClassWriter
ClassWriter which covers general resource specific operations.
A resource class must provide some typical properties/methods which are specified by this abstract class. These are
in particular:| Modifier and Type | Field and Description |
|---|---|
protected static String |
ABSTRACT_YRESOURCE |
protected static String |
READRESOURCE_METHOD |
protected static String |
WS_DELETE |
protected static String |
WS_GET |
static String |
WS_PATH |
static String |
WS_PATHPARAM |
protected static String |
WS_POST |
protected static String |
WS_PUT |
protected static String |
WS_RESPONSE |
GENERATED_NOTICE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractResourceWriter(ResourceConfig cfg,
CodeGenerator gen,
YExtension ext) |
| Modifier and Type | Method and Description |
|---|---|
protected MethodWriter |
createCRUDMethodWriter(String ano,
String methodName)
Creates a CRUD
MethodWriter template. |
protected MethodWriter |
createDefaultConstructorMethodWriter() |
protected abstract MethodWriter |
createDeleteMethodWriter() |
protected abstract MethodWriter |
createGetMethodWriter() |
protected abstract MethodWriter |
createPostMethodWriter() |
protected abstract MethodWriter |
createPutMethodWriter() |
protected MethodWriter |
createReadResourceMethodWriter(String returnClassType) |
protected Collection<MethodWriter> |
createResourceValueMethodWriters(String valueType,
String genericType,
String name) |
protected MethodWriter |
createSubResourceMethodWriter(ResourceConfig subResourceCfg,
boolean isSingleResource) |
protected void |
fill() |
String |
getClassName()
Returns the simple class name of the resource which shall be generated.
|
protected Collection<MethodWriter> |
getConstructorMethodWriters()
Returns the Constructor as
MethodWriter. |
protected Collection<MethodWriter> |
getCRUDMethodWriters()
Returns supported CRUD operations as
MethodWriter Collection |
protected Collection<MethodWriter> |
getCustomMethodWriters() |
protected abstract MethodWriter |
getReadResourceMethodWriter()
Returns the 'readResource'
MethodWriter. |
protected ResourceConfig |
getResourceConfig()
Returns the
ResourceConfig which is used for specific generation information. |
protected abstract Collection<MethodWriter> |
getResourceValueMethodWriters()
Convenience Getter/Setter
MethodWriter which delegates to AbstractResource#get/setResourceValue(...) but
is named more user-friendly. |
protected abstract Collection<MethodWriter> |
getSubResourceMethodWriters()
Returns supported sub-resources as
MethodWriter Collection |
addAnnotation, addConstantDeclaration, addConstantDeclaration, addConstructor, addDeclaration, addDeclaration, addDeclaration, addInterface, addMethod, assembleAbstractClassName, assembleClassName, containsAnnotation, disableSuppressPMD, firstLetterUpperCase, getAnnotations, getClassToExtend, getConstantDeclarations, getConstructors, getCopyright, getDeclarations, getExtension, getGenerator, getInfo, getInterfaces, getJavadoc, getMethods, getModifiers, getPackageName, getRequiredImports, getVisibility, isGeneratePartOf, setClassToExtend, setCopyright, setJavadoc, setModifiers, setPackageName, setVisibility, sortMethods, write, writeMethods, writeSignatureaddRequiredImportprotected static final String WS_GET
protected static final String WS_PUT
protected static final String WS_POST
protected static final String WS_DELETE
protected static final String WS_RESPONSE
public static final String WS_PATH
public static final String WS_PATHPARAM
protected static final String ABSTRACT_YRESOURCE
protected static final String READRESOURCE_METHOD
protected AbstractResourceWriter(ResourceConfig cfg, CodeGenerator gen, YExtension ext)
public String getClassName()
getClassName in class ClassWriterClassWriter.getClassName()protected ResourceConfig getResourceConfig()
ResourceConfig which is used for specific generation information.ResourceConfigprotected void fill()
fill in class ClassWriterprotected Collection<MethodWriter> getConstructorMethodWriters()
MethodWriter. Default implementation is default constructor.MethodWriterprotected Collection<MethodWriter> getCRUDMethodWriters()
MethodWriter CollectionMethodWriterprotected abstract Collection<MethodWriter> getSubResourceMethodWriters()
MethodWriter CollectionMethodWriterprotected abstract MethodWriter getReadResourceMethodWriter()
MethodWriter.MethodWriterprotected abstract Collection<MethodWriter> getResourceValueMethodWriters()
MethodWriter which delegates to AbstractResource#get/setResourceValue(...) but
is named more user-friendly.MethodWriterprotected Collection<MethodWriter> getCustomMethodWriters()
protected MethodWriter createDefaultConstructorMethodWriter()
protected abstract MethodWriter createGetMethodWriter()
protected abstract MethodWriter createDeleteMethodWriter()
protected abstract MethodWriter createPutMethodWriter()
protected abstract MethodWriter createPostMethodWriter()
protected Collection<MethodWriter> createResourceValueMethodWriters(String valueType, String genericType, String name)
protected MethodWriter createCRUDMethodWriter(String ano, String methodName)
MethodWriter template.ano - CRUD operation as annotation namemethodName - CRUD method nameMethodWriterprotected MethodWriter createReadResourceMethodWriter(String returnClassType)
protected MethodWriter createSubResourceMethodWriter(ResourceConfig subResourceCfg, boolean isSingleResource)
Copyright © 2017 SAP SE. All Rights Reserved.