Search in sources :

Example 21 with Annotation

use of io.siddhi.query.api.annotation.Annotation in project siddhi by wso2.

the class AbstractDefinition method toString.

protected String toString(String type) {
    StringBuilder definitionBuilder = new StringBuilder();
    if (annotations != null && annotations.size() > 0) {
        for (Annotation annotation : annotations) {
            definitionBuilder.append(annotation.toString());
        }
    }
    definitionBuilder.append("define ").append(type).append(" ").append(id).append(" (");
    boolean isFirst = true;
    for (Attribute attribute : attributeList) {
        if (!isFirst) {
            definitionBuilder.append(", ");
        } else {
            isFirst = false;
        }
        definitionBuilder.append(attribute.getName()).append(" ").append(attribute.getType().toString().toLowerCase(Locale.getDefault()));
    }
    definitionBuilder.append(")");
    return definitionBuilder.toString();
}
Also used : Annotation(io.siddhi.query.api.annotation.Annotation)

Aggregations

Annotation (io.siddhi.query.api.annotation.Annotation)21 Attribute (io.siddhi.query.api.definition.Attribute)10 SiddhiAppCreationException (io.siddhi.core.exception.SiddhiAppCreationException)8 Element (io.siddhi.query.api.annotation.Element)8 ArrayList (java.util.ArrayList)7 MetaStreamEvent (io.siddhi.core.event.stream.MetaStreamEvent)6 TableDefinition (io.siddhi.query.api.definition.TableDefinition)6 HashMap (java.util.HashMap)6 StreamEventCloner (io.siddhi.core.event.stream.StreamEventCloner)5 InMemoryTable (io.siddhi.core.table.InMemoryTable)4 Table (io.siddhi.core.table.Table)4 ConfigReader (io.siddhi.core.util.config.ConfigReader)4 OutputAttribute (io.siddhi.query.api.execution.query.selection.OutputAttribute)4 Extension (io.siddhi.query.api.extension.Extension)4 Map (java.util.Map)4 SiddhiAppContext (io.siddhi.core.config.SiddhiAppContext)3 StreamEventFactory (io.siddhi.core.event.stream.StreamEventFactory)3 VariableExpressionExecutor (io.siddhi.core.executor.VariableExpressionExecutor)3 StreamDefinition (io.siddhi.query.api.definition.StreamDefinition)3 SiddhiQueryContext (io.siddhi.core.config.SiddhiQueryContext)2