Search in sources :

Example 21 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project intellij-elixir by KronicDeth.

the class ElixirPsiImplUtil method quote.

@Contract(pure = true)
@NotNull
public static OtpErlangObject quote(PsiElement[] children) {
    List<Quotable> quotableList = new LinkedList<Quotable>();
    for (int i = 0; i < children.length; i++) {
        PsiElement child = children[i];
        if (child instanceof Quotable) {
            quotableList.add((Quotable) child);
        } else if (child instanceof Unquoted) {
            continue;
        } else {
            throw new NotImplementedException("Child, " + child + ", must be Quotable or Unquoted");
        }
    }
    Quotable[] quotableChildren = new Quotable[quotableList.size()];
    quotableList.toArray(quotableChildren);
    return quote(quotableChildren);
}
Also used : NotImplementedException(org.apache.commons.lang.NotImplementedException) LeafPsiElement(com.intellij.psi.impl.source.tree.LeafPsiElement) Contract(org.jetbrains.annotations.Contract) NotNull(org.jetbrains.annotations.NotNull)

Example 22 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project intellij-elixir by KronicDeth.

the class ModuleAttribute method handleElementRename.

@Override
public PsiElement handleElementRename(String newModuleAttributeName) throws IncorrectOperationException {
    PsiElement renamedElement = myElement;
    if (myElement instanceof AtNonNumericOperation) {
        PsiElement moduleAttributeUsage = ElementFactory.createModuleAttributeUsage(myElement.getProject(), newModuleAttributeName);
        renamedElement = myElement.replace(moduleAttributeUsage);
    } else if (myElement instanceof ElixirAtIdentifier) {
    // do nothing; handled by setName on ElixirAtUnqualifiedNoParenthesesCall
    } else {
        throw new NotImplementedException("Renaming module attribute reference on " + myElement.getClass().getCanonicalName() + " PsiElements is not implemented yet.  Please open an issue " + "(https://github.com/KronicDeth/intellij-elixir/issues/new) with the class name and the " + "sample text:\n" + myElement.getText());
    }
    return renamedElement;
}
Also used : NotImplementedException(org.apache.commons.lang.NotImplementedException)

Example 23 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project symmetric-ds by JumpMind.

the class DataService method getCsvDataFor.

protected String getCsvDataFor(ISqlTransaction transaction, Trigger trigger, TriggerHistory triggerHistory, String whereClause, boolean pkOnly) {
    String data = null;
    String sql = null;
    try {
        if (pkOnly) {
            sql = symmetricDialect.createCsvPrimaryKeySql(trigger, triggerHistory, engine.getConfigurationService().getChannel(trigger.getChannelId()), whereClause);
        } else {
            sql = symmetricDialect.createCsvDataSql(trigger, triggerHistory, engine.getConfigurationService().getChannel(trigger.getChannelId()), whereClause);
        }
    } catch (NotImplementedException e) {
    }
    if (isNotBlank(sql)) {
        data = transaction.queryForObject(sql, String.class);
    } else {
        DatabaseInfo databaseInfo = platform.getDatabaseInfo();
        String quote = databaseInfo.getDelimiterToken() == null || !parameterService.is(ParameterConstants.DB_DELIMITED_IDENTIFIER_MODE) ? "" : databaseInfo.getDelimiterToken();
        sql = "select " + triggerHistory.getColumnNames() + " from " + Table.getFullyQualifiedTableName(triggerHistory.getSourceCatalogName(), triggerHistory.getSourceSchemaName(), triggerHistory.getSourceTableName(), quote, databaseInfo.getCatalogSeparator(), databaseInfo.getSchemaSeparator()) + " t where " + whereClause;
        Row row = transaction.queryForRow(sql);
        if (row != null) {
            data = row.csvValue();
        }
    }
    if (data != null) {
        data = data.trim();
    }
    return data;
}
Also used : DatabaseInfo(org.jumpmind.db.platform.DatabaseInfo) NotImplementedException(org.apache.commons.lang.NotImplementedException) Row(org.jumpmind.db.sql.Row)

Example 24 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project iaf by ibissource.

the class JsonDocumentContainer method toString.

protected void toString(StringBuffer sb, Object item, int indentLevel) {
    if (item == null) {
        sb.append("null");
    } else if (item instanceof String) {
        sb.append(item);
    } else if (item instanceof Map) {
        sb.append("{");
        if (indentLevel >= 0)
            indentLevel++;
        for (Entry<String, Object> entry : ((Map<String, Object>) item).entrySet()) {
            newLine(sb, indentLevel);
            sb.append('"').append(entry.getKey()).append("\": ");
            toString(sb, entry.getValue(), indentLevel);
            sb.append(",");
        }
        sb.deleteCharAt(sb.length() - 1);
        if (indentLevel >= 0)
            indentLevel--;
        newLine(sb, indentLevel);
        sb.append("}");
    } else if (item instanceof List) {
        sb.append("[");
        if (indentLevel >= 0)
            indentLevel++;
        for (Object subitem : (List) item) {
            newLine(sb, indentLevel);
            toString(sb, subitem, indentLevel);
            sb.append(",");
        }
        sb.deleteCharAt(sb.length() - 1);
        if (indentLevel >= 0)
            indentLevel--;
        newLine(sb, indentLevel);
        sb.append("]");
    } else {
        throw new NotImplementedException("cannot handle class [" + item.getClass().getName() + "]");
    }
}
Also used : NotImplementedException(org.apache.commons.lang.NotImplementedException) List(java.util.List) Map(java.util.Map)

Example 25 with NotImplementedException

use of org.apache.commons.lang.NotImplementedException in project incubator-systemml by apache.

the class Program method clone.

public Program clone(boolean deep) {
    if (deep)
        throw new NotImplementedException();
    Program ret = new Program();
    // shallow copy of all program blocks
    ret._programBlocks.addAll(_programBlocks);
    // functions, which require a deep copy
    for (Entry<String, HashMap<String, FunctionProgramBlock>> e1 : _namespaceFunctions.entrySet()) for (Entry<String, FunctionProgramBlock> e2 : e1.getValue().entrySet()) {
        FunctionProgramBlock fpb = e2.getValue();
        if (fpb instanceof ExternalFunctionProgramBlock)
            fpb = createPartialDeepCopy(ret, (ExternalFunctionProgramBlock) fpb);
        ret.addFunctionProgramBlock(e1.getKey(), e2.getKey(), fpb);
    }
    return ret;
}
Also used : Entry(java.util.Map.Entry) DMLProgram(org.apache.sysml.parser.DMLProgram) HashMap(java.util.HashMap) NotImplementedException(org.apache.commons.lang.NotImplementedException)

Aggregations

NotImplementedException (org.apache.commons.lang.NotImplementedException)36 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 Path (org.apache.hadoop.fs.Path)4 ASTNode (com.intellij.lang.ASTNode)3 IElementType (com.intellij.psi.tree.IElementType)3 File (java.io.File)3 Collection (java.util.Collection)3 LinkedList (java.util.LinkedList)3 List (java.util.List)3 Entry (java.util.Map.Entry)3 NotNull (org.jetbrains.annotations.NotNull)3 LeafPsiElement (com.intellij.psi.impl.source.tree.LeafPsiElement)2 HashSet (java.util.HashSet)2 Map (java.util.Map)2 Set (java.util.Set)2 TableName (org.apache.hadoop.hbase.TableName)2 DMLProgram (org.apache.sysml.parser.DMLProgram)2 XSDConstrainingFacet (org.eclipse.xsd.XSDConstrainingFacet)2