Tabnine Logo
PropertyDescriptor.isDynamic
Code IndexAdd Tabnine to your IDE (free)

How to use
isDynamic
method
in
com.hurence.logisland.component.PropertyDescriptor

Best Java code snippets using com.hurence.logisland.component.PropertyDescriptor.isDynamic (Showing top 16 results out of 315)

origin: com.hurence.logisland/logisland-common-processors-plugin

@Override
public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) {
  if (descriptor.isDynamic()) {
    if (!StringUtils.equals(oldValue, newValue)) {
      if (oldValue != null) {
        cachedJsonPathMap.remove(oldValue);
      }
    }
  }
}
origin: com.hurence.logisland/logisland-common-processors-plugin

  private Map<String, String> getFieldsNameMapping(ProcessContext context) {
    /**
     * list alternative regex
     */
    Map<String, String> fieldsNameMappings = new HashMap<>();
    // loop over dynamic properties to add alternative regex
    for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
      if (!entry.getKey().isDynamic()) {
        continue;
      }

      final String fieldName = entry.getKey().getName();
      final String mapping = entry.getValue();

      fieldsNameMappings.put(fieldName, mapping);
    }
    return fieldsNameMappings;
  }
}
origin: com.hurence.logisland/logisland-common-processors-plugin

private Map<String, String[]> getFieldsNameMapping(ProcessContext context) {
  /**
   * list alternative regex
   */
  Map<String, String[]> fieldsNameMappings = new HashMap<>();
  // loop over dynamic properties to add alternative regex
  for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
    if (!entry.getKey().isDynamic()) {
      continue;
    }
    final String fieldName = entry.getKey().getName();
    final String[] mapping = entry.getValue().split(",");
    fieldsNameMappings.put(fieldName, mapping);
  }
  return fieldsNameMappings;
}
origin: com.hurence.logisland/logisland-common-processors-plugin

private Map<String, regexRule> getFieldsNameMapping(ProcessContext context) {
  /**
   * list alternative regex
   */
  Map<String, regexRule> fieldsNameMappings = new HashMap<>();
  // loop over dynamic properties to add alternative regex
  for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
    if (!entry.getKey().isDynamic()) {
      continue;
    }
    final String fieldName = entry.getKey().getName();
    final String[] splitedElements = entry.getValue().split(":", 2);
    if (splitedElements.length == 2) {
      String fieldToProduce = splitedElements[0];
      String regexp = splitedElements[1];
      fieldsNameMappings.put(fieldName, new regexRule(fieldToProduce, regexp));
    }
    else {
      // Ignore the mapping rule
      logger.warn("The mapping rule for {} has the invalid value: {}", entry.getKey().getName(), entry.getValue());
    }
  }
  return fieldsNameMappings;
}
origin: com.hurence.logisland/logisland-common-processors-plugin

if (!entry.getKey().isDynamic()) {
  continue;
origin: com.hurence.logisland/logisland-common-processors-plugin

private Map<String, regexRule> getFieldsNameMapping(ProcessContext context) {
  /**
   * list alternative regex
   */
  Map<String, regexRule> fieldsNameMappings = new HashMap<>();
  // loop over dynamic properties to add alternative regex
  for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
    if (!entry.getKey().isDynamic()) {
      continue;
    }
    final String fieldName = entry.getKey().getName();
    final String[] splitedElements = entry.getValue().split(":", 2);
    if (splitedElements.length == 2) {
      String[] fieldsToProduce = splitedElements[0].split(",");
      String regexp = splitedElements[1];
      fieldsNameMappings.put(fieldName, new regexRule(fieldsToProduce, regexp));
    }
    else {
      // Ignore the mapping rule
      logger.warn("The mapping rule for {} has the invalid value: {}", entry.getKey().getName(), entry.getValue());
    }
  }
  return fieldsNameMappings;
}
origin: com.hurence.logisland/logisland-common-processors-plugin

@Override
protected void setupDynamicProperties(ProcessContext context) {
  for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
    if (!entry.getKey().isDynamic()) {
      continue;
    }
    String key = entry.getKey().getName();
    String value = entry.getValue()
        .replaceAll("cache\\((\\S*\\))", "cache.get(\"test\", new com.hurence.logisland.record.StandardRecord().setId($1)")
        .replaceAll("\\.value", ".getField(com.hurence.logisland.record.FieldDictionary.RECORD_VALUE).asDouble()");
    StringBuilder sb = new StringBuilder();
    sb.append("var match=false;\n")
        .append("try {\n")
        .append("if( ")
        .append(value)
        .append(" ) { match=true; }\n")
        .append("} catch(error) {}");
    dynamicTagValuesMap.put(entry.getKey().getName(), sb.toString());
    //   System.out.println(sb.toString());
    //  logger.debug(sb.toString());
  }
  defaultCollection = context.getPropertyValue(DATASTORE_CACHE_COLLECTION).asString();
  recordTTL = context.getPropertyValue(RECORD_TTL).asInteger();
}
origin: com.hurence.logisland/logisland-common-processors-plugin

if (!entry.getKey().isDynamic()) {
  continue;
origin: com.hurence.logisland/logisland-common-processors-plugin

private List<AlternativeMappingPattern> getAlternativePatterns(ProcessContext context, String valueRegexString) {
  /**
   * list alternative regex
   */
  List<AlternativeMappingPattern> alternativeMappingRegex = new ArrayList<>();
  // loop over dynamic properties to add alternative regex
  for (final Map.Entry<PropertyDescriptor, String> entry : context.getProperties().entrySet()) {
    if (!entry.getKey().isDynamic()) {
      continue;
    }
    if(!entry.getKey().getName().toLowerCase().contains("alt.value.fields")){
      continue;
    }
    final String patternPropertyKey = entry.getKey().getName().toLowerCase().replace("fields", "regex");
    if(context.getPropertyValue(patternPropertyKey) != null){
      final String alternativeRegexString = context.getPropertyValue(patternPropertyKey).asString();
      final String mapping = entry.getValue();
      final Pattern pattern = Pattern.compile(alternativeRegexString);
      alternativeMappingRegex.add(new AlternativeMappingPattern(mapping, pattern));
    }
  }
  return alternativeMappingRegex;
}
origin: com.hurence.logisland/logisland-common-processors-plugin

if (!entry.getKey().isDynamic()) {
  continue;
origin: com.hurence.logisland/logisland-common-processors-plugin

@Override
protected Collection<ValidationResult> customValidate(final ValidationContext context) {
  final List<ValidationResult> results = new ArrayList<>(super.customValidate(context));
  int jsonPathCount = 0;
  for (final PropertyDescriptor desc : context.getProperties().keySet()) {
    if (desc.isDynamic()) {
      jsonPathCount++;
    }
  }
  if (jsonPathCount != 1) {
    results.add(new ValidationResult.Builder().subject("JsonPaths").valid(false)
        .explanation("Exactly one JsonPath must be set if using d").build());
  }
  return results;
}
origin: com.hurence.logisland/logisland-documentation

generator.writeBooleanField("isDynamic", property.isDynamic());
generator.writeBooleanField("isSensitive", property.isSensitive());
generator.writeBooleanField("isExpressionLanguageSupported", property.isExpressionLanguageSupported());
origin: com.hurence.logisland/logisland-common-processors-plugin

if (!entry.getKey().isDynamic()) {
  continue;
origin: com.hurence.logisland/logisland-querymatcher-plugin

if (!entry.getKey().isDynamic()) {
  continue;
origin: com.hurence.logisland/logisland-querymatcher-plugin

if (!entry.getKey().isDynamic()) {
  continue;
origin: com.hurence.logisland/logisland-api

private PropertyDescriptor getPropertyDescriptor(final PropertyDescriptor specDescriptor) {
  PropertyDescriptor descriptor = null;
  //check if property supported
  final List<PropertyDescriptor> supportedDescriptors = getSupportedPropertyDescriptors();
  if (supportedDescriptors != null) {
    for (final PropertyDescriptor desc : supportedDescriptors) { //find actual descriptor
      if (specDescriptor.equals(desc)) {
        return desc;
      }
    }
  }
  descriptor = getSupportedDynamicPropertyDescriptor(specDescriptor.getName());
  if (descriptor != null && !descriptor.isDynamic()) {
    descriptor = new PropertyDescriptor.Builder().fromPropertyDescriptor(descriptor).dynamic(true).build();
  }
  if (descriptor == null) {
    descriptor = new PropertyDescriptor.Builder().fromPropertyDescriptor(specDescriptor).addValidator(Validator.INVALID).dynamic(true).build();
  }
  return descriptor;
}
com.hurence.logisland.componentPropertyDescriptorisDynamic

Popular methods of PropertyDescriptor

  • getName
  • getDisplayName
  • equals
  • getDefaultValue
  • isExpressionLanguageSupported
  • isRequired
  • <init>
  • getAllowableValues
  • getControllerServiceDefinition
  • getDescription
  • isSensitive
  • validate
    Validates the given input against this property descriptor's validator. If this descriptor has a set
  • isSensitive,
  • validate

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JButton (javax.swing)
  • JFrame (javax.swing)
  • JPanel (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now