This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ExceptionHandler(EntityRecordException.class) | |
public ResponseEntity<?> handleEntityFoundException(EntityRecordException exception) { | |
HttpStatus httpStatus = HttpStatus.INTERNAL_SERVER_ERROR; | |
switch (exception.getErrorCode()) { | |
case MULTIPLE_LK_FOUND: | |
httpStatus = HttpStatus.CONFLICT; | |
break; | |
case LK_NOTFOUND: | |
case INSERTED_RECORD_NOT_FOUND: | |
httpStatus = HttpStatus.NOT_FOUND; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Lexer { | |
private StreamTokenizer input; | |
public enum TokenType { | |
INTERFACE("INTERFACE"), | |
ENTITY("ENTITY"), | |
EMBEDABLE("EMBEDABLE"), | |
IMPLEMENTS("IMPLEMENTS"), | |
L_BRACE("{"), | |
R_BRACE("}"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SchemaParser { | |
private Lexer lexer; | |
private TokenType currentToken; | |
public SchemaParser(Reader r) { | |
lexer = new Lexer(r); | |
} | |
private RawSchema parse() throws SyntaxError { | |
RawSchemaBuilder rawSchemaBuilder = new RawSchemaBuilder(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file name must be .travis.yml | |
language: java | |
jdk: openjdk10 | |
before_install: | |
- wget http://services.gradle.org/distributions/gradle-5.4.1-bin.zip | |
- unzip -qq gradle-5.4.1-bin.zip | |
- export GRADLE_HOME=$PWD/gradle-5.4.1 | |
- export PATH=$GRADLE_HOME/bin:$PATH | |
- gradle -v |
OlderNewer