private static void addTypeWithNameCheck(final Map<String, Type> typeByNameMap, final Type type, final Node node)
    {
        if (typeByNameMap.get(type.name()) != null)
        {
            handleWarning(node, "type already exists for name: " + type.name());
        }

        checkForValidName(node, type.name());

        typeByNameMap.put(type.name(), type);
    }
Check name against validity for C++ and Java naming. Warning if not valid.

@param node to have the name checked.
@param name of the node to be checked.
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java