Returns the key to the list of ColumnMetaData objects. Returns the
correct MetaData per the mapping file and the data contained on the line


@param columnMD
@param line
@return List - ColumMetaData
438734
public static String getCMDKey(final MetaData columnMD, final String line) {
        if (!columnMD.isAnyRecordFormatSpecified()) {
            // no <RECORD> elements were specified for this parse, just return the
            // detail id
            return FPConstants.DETAIL_ID;
        }
        final Iterator<Entry<String, XMLRecordElement>> mapEntries = columnMD.xmlRecordIterator();
        // loop through the XMLRecordElement objects and see if we need a
        // different MD object
        while (mapEntries.hasNext()) {
            final Entry<String, XMLRecordElement> entry = mapEntries.next();
            final XMLRecordElement recordXMLElement = entry.getValue();

            if (recordXMLElement.getEndPositition() > line.length()) {
                // make sure our substring is not going to fail
                continue;
            }
            final int subfrm = recordXMLElement.getStartPosition() - 1; // convert
            // to 0
            // based
            final int subto = recordXMLElement.getEndPositition();
            if (line.substring(subfrm, subto).equals(recordXMLElement.getIndicator())) {
                // we found the MD object we want to return
                return entry.getKey();
            }

        }

        // must be a detail line
        return FPConstants.DETAIL_ID;
    }
615610
private function getSearchableColumnNames(TableMetadata $tableMetadata): array
    {
        $columnNameList = [];
        foreach ($tableMetadata->getAllColumnMetadata() as $columnMetadata) {
            if ($columnMetadata->isStringType()) {
                $columnNameList[] = $columnMetadata->getColumnName();
            }
        }
        return $columnNameList;
    }
950560
public byte[] getContents(FileColumn[] columns, List<String[]> lines)
        throws IOException
    {
        byte[] ret;

        // Excel spreadsheet
        if(format.isExcel())
        {
            ret = getExcelOutput(columns, lines);
        }
        else // Assume it's a CSV file
        {
            ret = getCSVOutput(lines);
        }

        return ret;
    }
832270
protected void parseMetaDataLine(final ParserData parserData, final String line, int lineNumber) throws ParsingException {
        // Parse the line and break it up into the key/value pair
        Pair<String, String> keyValue = null;
        try {
            keyValue = ProcessorUtilities.getAndValidateKeyValuePair(line);
        } catch (InvalidKeyValueException e) {
            throw new ParsingException(format(ProcessorConstants.ERROR_INVALID_METADATA_FORMAT_MSG, lineNumber, line));
        }

        final String key = keyValue.getFirst();
        final String value = keyValue.getSecond();

        if (parserData.getParsedMetaDataKeys().contains(key.toLowerCase())) {
            throw new ParsingException(format(ProcessorConstants.ERROR_DUPLICATE_METADATA_FORMAT_MSG, lineNumber, key, line));
        } else {
            parserData.getParsedMetaDataKeys().add(key.toLowerCase());

            // first deal with metadata that is used by the parser or needs to be parsed further
            if (key.equalsIgnoreCase(CommonConstants.CS_SPACES_TITLE)) {
                // Read in the amount of spaces that were used for the content specification
                try {
                    parserData.setIndentationSize(Integer.parseInt(value));
                    if (parserData.getIndentationSize() <= 0) {
                        parserData.setIndentationSize(2);
                    }
                } catch (NumberFormatException e) {
                    throw new ParsingException(format(ProcessorConstants.ERROR_INVALID_NUMBER_MSG, lineNumber, line));
                }
            } else if (key.equalsIgnoreCase(CSConstants.DEBUG_TITLE)) {
                if (value.equals("1")) {
                    log.setVerboseDebug(1);
                } else if (value.equals("2")) {
                    log.setVerboseDebug(2);
                } else if (value.equals("0")) {
                    log.setVerboseDebug(0);
                } else {
                    log.warn(ProcessorConstants.WARN_DEBUG_IGNORE_MSG);
                }
            } else if (key.equalsIgnoreCase(CommonConstants.CS_INLINE_INJECTION_TITLE)) {
                final InjectionOptions injectionOptions = new InjectionOptions();
                String[] types = null;
                if (StringUtilities.indexOf(value, '[') != -1) {
                    if (StringUtilities.indexOf(value, ']') != -1) {
                        final Matcher matcher = SQUARE_BRACKET_PATTERN.matcher(value);

                        // Find all of the variables inside of the brackets defined by the regex
                        while (matcher.find()) {
                            final String topicTypes = matcher.group(ProcessorConstants.BRACKET_CONTENTS);
                            types = StringUtilities.split(topicTypes, ',');
                            for (final String type : types) {
                                injectionOptions.addStrictTopicType(type.trim());
                            }
                        }
                    } else {
                        throw new ParsingException(
                                format(ProcessorConstants.ERROR_NO_ENDING_BRACKET_MSG + ProcessorConstants.CSLINE_MSG, lineNumber, ']',
                                        line));
                    }
                }
                String injectionSetting = getTitle(value, '[');
                if (injectionSetting == null) {
                    throw new ParsingException(format(ProcessorConstants.ERROR_INVALID_INJECTION_MSG, lineNumber, line));
                } else if (injectionSetting.trim().equalsIgnoreCase("on")) {
                    if (types != null) {
                        injectionOptions.setContentSpecType(InjectionOptions.UserType.STRICT);
                    } else {
                        injectionOptions.setContentSpecType(InjectionOptions.UserType.ON);
                    }
                } else if (injectionSetting.trim().equalsIgnoreCase("off")) {
                    injectionOptions.setContentSpecType(InjectionOptions.UserType.OFF);
                } else {
                    throw new ParsingException(format(ProcessorConstants.ERROR_INVALID_INJECTION_MSG, lineNumber, line));
                }
                parserData.getContentSpec().setInjectionOptions(injectionOptions);
            } else if (key.equalsIgnoreCase(CommonConstants.CS_FILE_TITLE) || key.equalsIgnoreCase(CommonConstants.CS_FILE_SHORT_TITLE)) {
                final FileList files = parseFilesMetaData(parserData, value, lineNumber, line);
                parserData.getContentSpec().appendKeyValueNode(files);
            } else if (isSpecTopicMetaData(key, value)) {
                final SpecTopic specTopic = parseSpecTopicMetaData(parserData, value, key, lineNumber);
                parserData.getContentSpec().appendKeyValueNode(new KeyValueNode<SpecTopic>(key, specTopic, lineNumber));
            } else {
                try {
                    final KeyValueNode<String> node;
                    if (ContentSpecUtilities.isMetaDataMultiLine(key)) {
                        node = parseMultiLineMetaData(parserData, key, value, lineNumber);
                    } else {
                        node = new KeyValueNode<String>(key, value, lineNumber);
                    }
                    parserData.getContentSpec().appendKeyValueNode(node);
                } catch (NumberFormatException e) {
                    throw new ParsingException(format(ProcessorConstants.ERROR_INVALID_METADATA_FORMAT_MSG, lineNumber, line));
                }
            }
        }
    }
543499
public static String[] getColumnNames(DataSource ds, String tableName) {
		List<String> columnNames = new ArrayList<String>();
		Connection conn = null;
		ResultSet rs = null;
		try {
			conn = ds.getConnection();
			final DatabaseMetaData metaData = conn.getMetaData();
			rs = metaData.getColumns(conn.getCatalog(), null, tableName, null);
			while (rs.next()) {
				columnNames.add(rs.getString("COLUMN_NAME"));
			}
			return columnNames.toArray(new String[columnNames.size()]);
		} catch (Exception e) {
			throw new DbRuntimeException("Get columns error!", e);
		} finally {
			DbUtil.close(rs, conn);
		}
	}
184063
private static String[] getNmeaItems(String line) {
        String[] items = StringUtils.splitByWholeSeparatorPreserveAllTokens(line,
                PARAMETER_DELIMITER);
        // remove the checksum from the end
        String last = items[items.length - 1];
        if (last.contains("*"))
            items[items.length - 1] = last.substring(0, last.lastIndexOf('*'));
        return items;
    }
132811
public <E> List<E> findData(EntityMetadata m, Object rowKey, byte[] startRow, byte[] endRow,
            List<Map<String, Object>> columnsToOutput, Filter filters)
    {
        String tableName = HBaseUtils.getHTableName(m.getSchema(), m.getTableName());
        FilterList filterList = getFilterList(filters);
        try
        {
            return handler.readData(tableName, m, rowKey, startRow, endRow, columnsToOutput, filterList);
        }
        catch (IOException ioex)
        {
            log.error("Error during find by range, Caused by: .", ioex);
            throw new KunderaException("Error during find by range, Caused by: .", ioex);
        }
    }
803865
public Object get(String columnId) throws CmsIllegalArgumentException {

        if ((getMetadata().getColumnDefinition(columnId) == null)
            && (getMetadata().getItemDetailDefinition(columnId) == null)) {
            throw new CmsIllegalArgumentException(
                Messages.get().container(Messages.ERR_LIST_INVALID_COLUMN_1, columnId));
        }
        return m_values.get(columnId);
    }
546749
private String getMatchedTabledKeyword(String line) {
    	for (String keyword : Config.TABLE_KEYWORDS) {
    		if (line.startsWith(keyword)) {
    			return keyword;
    		}
    	}
    	return null;
    }
1129743
static public Map<String, ColumnMetaData> createMapByLabelOrName(ResultSetMetaData m) throws SQLException{
		Map<String, ColumnMetaData> result = new HashMap<String, ColumnMetaData>();
		for (int i = 1; i <= m.getColumnCount(); i ++){
			ColumnMetaData cm = new ColumnMetaData(m, i);
			result.put(cm.getLabelOrName(), cm);
		}
		return result;
	}
891870
public function getColumnMetadata($column)
    {
        if (!$this->columnDispatch) {
            $this->buildColumnDispatch();
        }

        if (!empty($this->columnDispatch[$column])) {
            $metaData = array();

            foreach ($this->columnDispatch[$column] as $handler) {
                /**
                 * @var GridField_ColumnProvider $handler
                 */
                $columnMetaData = $handler->getColumnMetadata($this, $column);

                if (is_array($columnMetaData)) {
                    $metaData = array_merge($metaData, $columnMetaData);
                    continue;
                }

                throw new LogicException(sprintf(
                    'Non-array response from %s::getColumnMetadata().',
                    get_class($handler)
                ));
            }

            return $metaData;
        }

        throw new InvalidArgumentException(sprintf(
            'Bad column "%s"',
            $column
        ));
    }
563874
protected static ResultSet getColumnMetaData (Connection conn, String table, String column)
        throws SQLException
    {
        ResultSet rs = conn.getMetaData().getColumns("", "", table, column);
        while (rs.next()) {
            String tname = rs.getString("TABLE_NAME");
            String cname = rs.getString("COLUMN_NAME");
            if (tname.equals(table) && cname.equals(column)) {
                return rs;
            }
        }
        throw new SQLException("Table or Column not defined. [table=" + table +
                               ", col=" + column + "].");
    }
425430
public final B addKey(String column) {
        return addMapping(column, calculatedIndex++, FieldMapperColumnDefinition.<K>key());
    }
468920
@Override
    public String[] getColumns(final String recordID) {
        String[] array = null;

        if (metaData != null) {
            final List cmds = ParserUtils.getColumnMetaData(recordID, metaData);
            array = new String[cmds.size()];
            for (int i = 0; i < cmds.size(); i++) {
                final ColumnMetaData column = (ColumnMetaData) cmds.get(i);
                array[i] = column.getColName();
            }
        }

        return array;
    }
217479
private Number getIdColumnData(ResultSet resultSet, ResultSetMetaData metaData, int columnIndex)
			throws SQLException {
		int typeVal = metaData.getColumnType(columnIndex);
		switch (typeVal) {
			case Types.BIGINT:
			case Types.DECIMAL:
			case Types.NUMERIC:
				return (Number) resultSet.getLong(columnIndex);
			case Types.INTEGER:
				return (Number) resultSet.getInt(columnIndex);
			default:
				String columnName = metaData.getColumnName(columnIndex);
				throw new SQLException(
						"Unexpected ID column type " + TypeValMapper.getSqlTypeForTypeVal(typeVal) + " (typeVal "
								+ typeVal + ") in column " + columnName + "(#" + columnIndex + ") is not a number");
		}
	}
973980
def parse_metadata(lines):
    
    meta = defaultdict(list)
    for line in lines:
        line = line.rstrip()
        if line.startswith("!"):
            if "_table_begin" in line or "_table_end" in line:
                continue
            key, value = __parse_entry(line)
            meta[key].append(value)

    return dict(meta)
41183
protected List<ColumnDef> getIndexes() throws IOException
    {
        CfDef cfdef = getCfInfo(loadSignature).cfDef;
        List<ColumnDef> indexes = new ArrayList<ColumnDef>();
        for (ColumnDef cdef : cfdef.column_metadata)
        {
            if (cdef.index_type != null)
                indexes.add(cdef);
        }
        return indexes;
    }