Package edu.wpi.grip.ui.codegeneration
Class TemplateMethods
- java.lang.Object
-
- edu.wpi.grip.ui.codegeneration.TemplateMethods
-
- Direct Known Subclasses:
CppTMethods
,JavaTMethods
,PythonTMethods
public abstract class TemplateMethods extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TemplateMethods()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.String
callOp(TStep step)
Converts a step into a string the represents the call of the operation in the correct language.static TemplateMethods
get(Language lang)
gets a TemplateMethod of the desired language.abstract java.lang.String
getterName(java.lang.String name)
Converts a name into the format for the correct language.abstract java.lang.String
name(java.lang.String name)
Converts a name into the format for the correct language.static java.lang.String
parseSocketName(Socket socket)
Takes a socket and returns the Name.static java.lang.String
parseSocketType(Socket socket)
Takes a socket and returns the type as a string.static java.lang.String
parseSocketValue(Socket socket)
takes a socket and returns the value.abstract java.lang.String
setterName(java.lang.String name)
Converts a name into the format for the correct language.
-
-
-
Method Detail
-
get
public static TemplateMethods get(Language lang)
gets a TemplateMethod of the desired language.- Parameters:
lang
- the desired language that will be exported- Returns:
- The template method of the correct language.
-
parseSocketValue
public static java.lang.String parseSocketValue(Socket socket)
takes a socket and returns the value.- Parameters:
socket
- the socket to be parsed- Returns:
- the value of the socket or "null" if there is no value
-
parseSocketName
public static java.lang.String parseSocketName(Socket socket)
Takes a socket and returns the Name.- Parameters:
socket
- the socket to be parsed- Returns:
- the name in Lower camel case.
-
parseSocketType
public static java.lang.String parseSocketType(Socket socket)
Takes a socket and returns the type as a string.- Parameters:
socket
- The socket that will be parsed.- Returns:
- The type of the socket with any needed additional information.
-
name
public abstract java.lang.String name(java.lang.String name)
Converts a name into the format for the correct language.- Parameters:
name
- the unformatted name- Returns:
- the name after it has been formatted
-
getterName
public abstract java.lang.String getterName(java.lang.String name)
Converts a name into the format for the correct language.- Parameters:
name
- the unformatted name- Returns:
- the name after it has been formatted
-
setterName
public abstract java.lang.String setterName(java.lang.String name)
Converts a name into the format for the correct language.- Parameters:
name
- the unformatted name- Returns:
- the name after it has been formatted
-
callOp
public abstract java.lang.String callOp(TStep step)
Converts a step into a string the represents the call of the operation in the correct language. Used in the Templates- Parameters:
step
- the step that will be called- Returns:
- a string that is the call to the operation.
-
-