java-classname-generator / generator.py

@ 2559f943a53a48f5ad8d8f98a43657312eaea4aa | history


from flask import Flask, render_template
from random import choice, sample
app = Flask(__name__)

FIRSTS = [
'Abstract',
'AnnotationMethod',
'Application',
'Aspect',
'Base',
'Configurable',
'Data',
'Default',
'Generic',
'Mock',
'Mutable',
'Namespace',
'Simple',
'Sql',
'Invalid',
'Internal',
'Jdbc',
'Standard',
'Transaction']

MIDDLES = [
'ContextAware',
'Frame',
'Factory',
'Auto',
'Meta',
'PostProcessing',
'Http',
'Bound',
'Element',
'Pdf',
'Reflective',
'Refreshable',
'Hashable',
'Regexp',
'Method',
'Value',
'Type',
'Stateless',
'Theme',
'Entry',
'Window',
'Config',
'Session',
'ASync',
'Byte',
'Caching',
'Char',
'Array',
'List',
'Xml',
'Streaming',
'Multipart',
'Throttle',
'Parallel',
'Service',
'Task',
'Trigger',
'Binding',
'Remote',
'ToString',
'Enum',
'Style',
'IO',
'DependsOn',
'Embedded',
'Database',
'Client',
'Service',
'Expected',
'Proxy',
'Jax',
'Name',
'Request',
'Pooled',
'Json',
'Parameterized',
'NonTransient',
'Instanceof',
'ParamAware',
'Socket',
'Sequence',
'Undefined',
'Loader',
'Invocation',
'Timed',
'Method',
'MaxValue',
'MinValue',
'Url',
'Resource',
'Pattern',
'Help',
'Entity',
'Invocation',
'Extracting',
'Servlet',
'Script',
'ResultSet',
'Scope',
'Application',
'Mail',
'Throwaway',
'Connection',
'Node',
'Static',
'Procedure',
'Labeled',
'Toolbox',
'Command',
'View',
'Model',
'Feed',
'Manual']

LASTS = [
'Logger',
'Handler',
'Exception',
'Adapter',
'Factory',
'Bean',
'Context',
'Resolver',
'Detector',
'Advisor',
'Interceptor',
'Translator',
'PostProcessor',
'TaskExecutor',
'Controller',
'Loader',
'Module',
'Scope',
'Override',
'Descriptor',
'Configurer',
'Utils',
'Generator',
'Expression',
'Wrapper',
'Chain',
'Dispatcher',
'Validator',
'Literal',
'Tag',
'Dao',
'Daemon',
'Template']

@app.route("/")
def main():
    class_name = generate_class_name()
    return render_template('index.html', class_name=class_name)

def generate_class_name():
    return choice(FIRSTS) + ''.join(sample(MIDDLES, 4)) + choice(LASTS)

if __name__ == "__main__":
    app.run()