@Override public Object call(final Object iArgument) { return OIOUtils.getStringContent(iArgument); } });
@Override public Object call(final Object iArgument) { return OIOUtils.getStringContent(iArgument); } });
/** * Use OIOUtils.getStringContent(iValue) instead. * * @param iValue * * @return */ @Deprecated public static String getStringContent(final Object iValue) { // MOVED return OIOUtils.getStringContent(iValue); }
public void setRoot(final OBaseParser iQueryToParse, final String iRoot) { if (isStringLiteral(iRoot)) { this.stringValue = OIOUtils.getStringContent(iRoot); } //TODO support all the basic types this.name = OIOUtils.getStringContent(iRoot); }
@Override public Object execute(Object iThis, OIdentifiable iCurrentRecord, OCommandContext iContext, Object ioResult, Object[] iParams) { final String toFind = OIOUtils.getStringContent(iParams[0].toString()); return iParams.length > 1 ? iThis.toString().lastIndexOf(toFind, Integer.parseInt(iParams[1].toString())) : iThis.toString() .lastIndexOf(toFind); } }
@Override public Object execute(Object iThis, OIdentifiable iCurrentRecord, OCommandContext iContext, Object ioResult, Object[] iParams) { final String toFind = OIOUtils.getStringContent(iParams[0].toString()); int startIndex = iParams.length > 1 ? Integer.parseInt(iParams[1].toString()) : 0; return iThis != null ? iThis.toString().indexOf(toFind, startIndex) : null; } }
public OSQLFilterItemField(final String iName, final OClass iClass) { this.name = OIOUtils.getStringContent(iName); collate = getCollateForField(iClass, name); if (iClass != null) { collatePreset = true; } }
@Override public Object execute(Object iThis, OIdentifiable iCurrentRecord, OCommandContext iContext, Object ioResult, Object[] iParams) { if (ioResult != null) { final Normalizer.Form form = iParams != null && iParams.length > 0 ? Normalizer.Form.valueOf(OIOUtils .getStringContent(iParams[0].toString())) : Normalizer.Form.NFD; String normalized = Normalizer.normalize(ioResult.toString(), form); if (iParams != null && iParams.length > 1) { normalized = normalized.replaceAll(OIOUtils.getStringContent(iParams[0].toString()), ""); } else { normalized = OPatternConst.PATTERN_DIACRITICAL_MARKS.matcher(normalized).replaceAll(""); } ioResult = normalized; } return ioResult; } }
protected static Object getIndexPart(final OCommandContext iContext, final String indexPart) { Object index = indexPart; if (indexPart.indexOf(',') == -1 && (indexPart.charAt(0) == '"' || indexPart.charAt(0) == '\'')) index = OIOUtils.getStringContent(indexPart); else if (indexPart.charAt(0) == '$') { final Object ctxValue = iContext.getVariable(indexPart); if (ctxValue == null) return null; index = ctxValue; } else if (!Character.isDigit(indexPart.charAt(0))) // GET FROM CURRENT VALUE index = indexPart; return index; }
private Object getValueAsMap(ODocument iRecord, String iFieldValue, OType iLinkedType, Map<String, Character> iFieldTypes, boolean iNoMap, String iOptions, String[] fields) { if (fields.length % 2 == 1) throw new OSerializationException("Bad JSON format on map. Expected pairs of field:value but received '" + iFieldValue + "'"); final Map<String, Object> embeddedMap = new LinkedHashMap<String, Object>(); for (int i = 0; i < fields.length; i += 2) { String iFieldName = fields[i]; if (iFieldName.length() >= 2) iFieldName = iFieldName.substring(1, iFieldName.length() - 1); iFieldValue = fields[i + 1]; final String valueAsString = OIOUtils.getStringContent(iFieldValue); embeddedMap.put(iFieldName, getValue(iRecord, null, iFieldValue, valueAsString, iLinkedType, null, iFieldTypes, iNoMap, iOptions)); } return embeddedMap; }
public ODatabaseTool setOptions(final String iOptions) { if (iOptions != null) { final List<String> options = OStringSerializerHelper.smartSplit(iOptions, ' '); for (String o : options) { final int sep = o.indexOf('='); if (sep == -1) { parseSetting(o, Collections.EMPTY_LIST); } else { final String option = o.substring(0, sep); final String value = OIOUtils.getStringContent(o.substring(sep + 1)); final List<String> items = OStringSerializerHelper.smartSplit(value, ' '); parseSetting(option, items); } } } return this; }
private void parseCollection(ODocument iRecord, String iFieldValue, OType iType, OType iLinkedType, Map<String, Character> iFieldTypes, boolean iNoMap, String iOptions, CollectionItemVisitor visitor) { if (!iFieldValue.isEmpty()) { for (String item : OStringSerializerHelper.smartSplit(iFieldValue, ',')) { final String itemValue = item.trim(); if (itemValue.length() == 0) continue; final Object collectionItem = getValue(iRecord, null, itemValue, OIOUtils.getStringContent(itemValue), iLinkedType, null, iFieldTypes, iNoMap, iOptions); // TODO redundant in some cases, owner is already added by getValue in some cases if (shouldBeDeserializedAsEmbedded(collectionItem, iType)) ODocumentInternal.addOwner((ODocument) collectionItem, iRecord); visitor.visitItem(collectionItem); } } }
checkIsRecordResultSet(lastResult); } else if (iValue.startsWith("\"") && iValue.endsWith("\"") || iValue.startsWith("'") && iValue.endsWith("'")) { lastResult = new OContextVariableResolver(context).parse(OIOUtils.getStringContent(iValue)); checkIsRecordResultSet(lastResult); } else if (iValue.startsWith("(") && iValue.endsWith(")"))
final String word = OIOUtils.getStringContent(parserNextWord(true)); if (!OPatternConst.PATTERN_FETCH_PLAN.matcher(word).matches()) { break; fetchPlan = OIOUtils.getStringContent(parserText.substring(start)); } else { fetchPlan = OIOUtils.getStringContent(parserText.substring(start, end));
case STRING: if (iValue instanceof String) { final String s = OIOUtils.getStringContent(iValue); return OStringSerializerHelper.decode(s);
paramWeightFieldName = OIOUtils.getStringContent(iParams[2]);
code = OIOUtils.getStringContent(parserNextWord(false));
private Object getValueAsRecord(ODocument iRecord, String iFieldValue, OType iType, String iOptions, String[] fields) { ORID rid = new ORecordId(OIOUtils.getStringContent(getFieldValue("@rid", fields))); boolean shouldReload = rid.isTemporary(); final ODocument recordInternal = (ODocument) fromString(iFieldValue, new ODocument(), null, iOptions, shouldReload); if (shouldBeDeserializedAsEmbedded(recordInternal, iType)) ODocumentInternal.addOwner(recordInternal, iRecord); else { ODatabaseDocument database = ODatabaseRecordThreadLocal.instance().getIfDefined(); if (rid.isPersistent() && database != null) { ODocument documentToMerge = database.load(rid); documentToMerge.merge(recordInternal, false, false); return documentToMerge; } } return recordInternal; }
else if (configuredParameters[i] instanceof String) { if (configuredParameters[i].toString().startsWith("\"") || configuredParameters[i].toString().startsWith("'")) runtimeParameters[i] = OIOUtils.getStringContent(configuredParameters[i]);
else if (configuredParameters[i] instanceof String) { if (configuredParameters[i].toString().startsWith("\"") || configuredParameters[i].toString().startsWith("'")) runtimeParameters[i] = OIOUtils.getStringContent(configuredParameters[i]);