<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> from googleapis . codegen import api_library_generator <EOL> from googleapis . codegen import data_types <EOL> from googleapis . codegen . java_generator import Java14LanguageModel <EOL> from googleapis . codegen . java_generator import JavaApi <EOL> class JavaProtoGenerator ( api_library_generator . ApiLibraryGenerator ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , discovery , language = '<STR_LIT>' , language_model = None , <EOL> options = None ) : <EOL> if not language_model : <EOL> language_model = self . _GetDefaultLanguageModel ( options ) <EOL> super ( JavaProtoGenerator , self ) . __init__ ( JavaApi , discovery , language , <EOL> language_model , options = options ) <EOL> @ classmethod <EOL> def _GetDefaultLanguageModel ( cls , options = None ) : <EOL> return Java14LanguageModel ( options = options ) <EOL> def AnnotateMethod ( self , unused_the_api , method , unused_resource ) : <EOL> """<STR_LIT>""" <EOL> for attr in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> schema = method . get ( attr ) <EOL> if schema and not isinstance ( schema , data_types . Void ) : <EOL> name = schema . get ( '<STR_LIT>' ) <EOL> if not name : <EOL> raise ValueError ( '<STR_LIT>' <EOL> % ( schema [ '<STR_LIT:id>' ] , attr , method [ '<STR_LIT>' ] ) ) <EOL> java_name = schema . get ( '<STR_LIT>' ) <EOL> proto_name = java_name or '<STR_LIT>' + name [ name . rfind ( '<STR_LIT:.>' ) + <NUM_LIT:1> : ] <EOL> schema . SetTemplateValue ( '<STR_LIT>' , proto_name ) </s>
