*
* @see org.modeshape.sequencer.ddl.datatype.DataTypeParser#parseCustomType(org.modeshape.sequencer.ddl.DdlTokenStream)
*/
@Override
protected DataType parseCustomType( DdlTokenStream tokens ) throws ParsingException {
DataType dataType = null;
String typeName = null;
long length = 0;
if (tokens.matches(DerbyDataTypes.DTYPE_BINARY_LARGE_OBJECT)
|| tokens.matches(DerbyDataTypes.DTYPE_CHARACTER_LARGE_OBJECT)) {
dataType = new DataType();
typeName = consume(tokens, dataType, true) + SPACE + consume(tokens, dataType, true) + SPACE
+ consume(tokens, dataType, true);
if (canConsume(tokens, dataType, true, L_PAREN)) {
String lengthValue = consume(tokens, dataType, false);
length = parseLong(lengthValue);
consume(tokens, dataType, true, R_PAREN);
}
dataType.setName(typeName);
dataType.setLength(length);
} else if (tokens.matches(DerbyDataTypes.DTYPE_CLOB) || tokens.matches(DerbyDataTypes.DTYPE_BLOB)) {
dataType = new DataType();
typeName = consume(tokens, dataType, true);
if (canConsume(tokens, dataType, true, L_PAREN)) {
String lengthValue = consume(tokens, dataType, false);
length = parseLong(lengthValue);
consume(tokens, dataType, true, R_PAREN);
}
dataType.setName(typeName);
dataType.setLength(length);
} else if (tokens.matches(DerbyDataTypes.DTYPE_BIGINT)) {
dataType = new DataType();
typeName = consume(tokens, dataType, true);
dataType.setName(typeName);
} else if (tokens.matches(DerbyDataTypes.DTYPE_LONG_VARCHAR_FBD)) {
dataType = new DataType();
typeName = consume(tokens, dataType, true) + SPACE + consume(tokens, dataType, true) + SPACE
+ consume(tokens, dataType, true) + SPACE + consume(tokens, dataType, true) + SPACE
+ consume(tokens, dataType, true);
dataType.setName(typeName);
} else if (tokens.matches(DerbyDataTypes.DTYPE_LONG_VARCHAR)) {
dataType = new DataType();
typeName = consume(tokens, dataType, true) + SPACE + consume(tokens, dataType, true);
typeName = consume(tokens, dataType, true);
dataType.setName(typeName);
} else if (tokens.matches(DerbyDataTypes.DTYPE_DOUBLE)) {
dataType = new DataType();
typeName = consume(tokens, dataType, true);
dataType.setName(typeName);
} else if (tokens.matches(DerbyDataTypes.DTYPE_XML)) {
dataType = new DataType();
typeName = consume(tokens, dataType, true);
dataType.setName(typeName);
}
if (dataType == null) {
super.parseCustomType(tokens);
}