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 java.lang.String |
ABSTRACT_YRESOURCE |
protected static java.lang.String |
READRESOURCE_METHOD |
protected static java.lang.String |
WS_DELETE |
protected static java.lang.String |
WS_GET |
static java.lang.String |
WS_PATH |
static java.lang.String |
WS_PATHPARAM |
protected static java.lang.String |
WS_POST |
protected static java.lang.String |
WS_PUT |
protected static java.lang.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(java.lang.String ano,
java.lang.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(java.lang.String returnClassType) |
protected java.util.Collection<MethodWriter> |
createResourceValueMethodWriters(java.lang.String valueType,
java.lang.String genericType,
java.lang.String name) |
protected MethodWriter |
createSubResourceMethodWriter(ResourceConfig subResourceCfg,
boolean isSingleResource) |
protected void |
fill() |
java.lang.String |
getClassName()
Returns the simple class name of the resource which shall be generated.
|
protected java.util.Collection<MethodWriter> |
getConstructorMethodWriters()
Returns the Constructor as
MethodWriter. |
protected java.util.Collection<MethodWriter> |
getCRUDMethodWriters()
Returns supported CRUD operations as
MethodWriter Collection |
protected java.util.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 java.util.Collection<MethodWriter> |
getResourceValueMethodWriters()
Convenience Getter/Setter
MethodWriter which delegates to AbstractResource#get/setResourceValue(...) but
is named more user-friendly. |
protected abstract java.util.Collection<MethodWriter> |
getSubResourceMethodWriters()
Returns supported sub-resources as
MethodWriter Collection |
addAnnotation, addAnnotations, 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, isSuppressPMD, processAnnotations, removeSelfImport, setClassToExtend, setCopyright, setJavadoc, setModifiers, setPackageName, setVisibility, sortMethods, write, writeMethods, writeSignatureaddRequiredImportprotected static final java.lang.String WS_GET
protected static final java.lang.String WS_PUT
protected static final java.lang.String WS_POST
protected static final java.lang.String WS_DELETE
protected static final java.lang.String WS_RESPONSE
public static final java.lang.String WS_PATH
public static final java.lang.String WS_PATHPARAM
protected static final java.lang.String ABSTRACT_YRESOURCE
protected static final java.lang.String READRESOURCE_METHOD
protected AbstractResourceWriter(ResourceConfig cfg, CodeGenerator gen, YExtension ext)
public java.lang.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 java.util.Collection<MethodWriter> getConstructorMethodWriters()
MethodWriter. Default implementation is default constructor.MethodWriterprotected java.util.Collection<MethodWriter> getCRUDMethodWriters()
MethodWriter CollectionMethodWriterprotected abstract java.util.Collection<MethodWriter> getSubResourceMethodWriters()
MethodWriter CollectionMethodWriterprotected abstract MethodWriter getReadResourceMethodWriter()
MethodWriter.MethodWriterprotected abstract java.util.Collection<MethodWriter> getResourceValueMethodWriters()
MethodWriter which delegates to AbstractResource#get/setResourceValue(...) but
is named more user-friendly.MethodWriterprotected java.util.Collection<MethodWriter> getCustomMethodWriters()
protected MethodWriter createDefaultConstructorMethodWriter()
protected abstract MethodWriter createGetMethodWriter()
protected abstract MethodWriter createDeleteMethodWriter()
protected abstract MethodWriter createPutMethodWriter()
protected abstract MethodWriter createPostMethodWriter()
protected java.util.Collection<MethodWriter> createResourceValueMethodWriters(java.lang.String valueType, java.lang.String genericType, java.lang.String name)
protected MethodWriter createCRUDMethodWriter(java.lang.String ano, java.lang.String methodName)
MethodWriter template.ano - CRUD operation as annotation namemethodName - CRUD method nameMethodWriterprotected MethodWriter createReadResourceMethodWriter(java.lang.String returnClassType)
protected MethodWriter createSubResourceMethodWriter(ResourceConfig subResourceCfg, boolean isSingleResource)
Copyright © 2018 SAP SE. All Rights Reserved.