Java wrapper for {@link FeatureSpec#extractWithSettings(String, FeatureBuilder, ClassTag).
186217
public JRecordExtractor<T, Example>
  extractWithSettingsExample(String settings) {
    return new JRecordExtractor<>(JavaOps.extractWithSettingsExample(self, settings));
  }
576487
@Override
	public void setFeature(String feature, boolean value) {
		if (XmlPullParser.FEATURE_PROCESS_NAMESPACES.equals(feature)) {
			processNsp = value;
		} else if (XmlPullParser.FEATURE_PROCESS_DOCDECL.equals(feature)) {
			processDocDecl = value;
		} else if (FEATURE_RELAXED.equals(feature)) {
			relaxed = value;
		} else {
			throw new KriptonRuntimeException("unsupported feature: " + feature, true, this.getLineNumber(), this.getColumnNumber(), getPositionDescription(), null);
		}
	}
1006375
private void extractConfigSettings(Artifact artifact) throws MojoExecutionException {// NOSONAR
        try (JarFile configSettings = new JarFile(artifact.getFile())) {
            Enumeration<JarEntry> entries = configSettings.entries();
            while (entries.hasMoreElements()) {
                JarEntry jarFileEntry = entries.nextElement();
                // Only interested in files in the /bin directory that are not properties files
                if (!jarFileEntry.isDirectory() && jarFileEntry.getName().startsWith("bin")
                        && !jarFileEntry.getName().endsWith(".properties")) {
                    File fileToCreate = new File(jmeterDirectory, jarFileEntry.getName());
                    copyInputStreamToFile(configSettings.getInputStream(jarFileEntry), fileToCreate);
                }
            }
        } catch (IOException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }
958858
private static void readSettings(XmlPullParser parser, GVRContext context, CursorManager
            cursorManager) throws XmlPullParserException, IOException {

        Map<String, CursorTheme> themes = cursorManager.getThemeMap();

        parser.require(XmlPullParser.START_TAG, null, SETTINGS);
        while (parser.next() != XmlPullParser.END_TAG) {
            if (parser.getEventType() == XmlPullParser.TEXT) {
                continue;
            } else if (parser.getEventType() != XmlPullParser.START_TAG) {
                throw new XmlPullParserException("Cannot find start tag");
            }
            String name = parser.getName();
            Log.d(TAG, "Reading tag:" + name);
            // Starts by looking for the entry tag
            if (name.equals(GLOBAL)) {
                GlobalSettingsFactory.readGlobalSettings(parser);
            } else if (name.equals(THEME)) {
                Log.d(TAG, "Reading the theme tag");
                CursorTheme theme = CursorThemeFactory.readTheme(parser, context);
                themes.put(theme.getId(), theme);
            } else if (name.equals(CURSOR)) {
                Log.d(TAG, "Reading the cursor tag");
                cursorManager.addCursor(CursorFactory.readCursor(parser, context, cursorManager));
            }
        }
        if (0 == cursorManager.getCursorCount()) {
            throw new XmlPullParserException("No cursors specified in settings.xml");
        }
    }
813383
@SuppressWarnings("unchecked")
  @Override
  protected void loadSettings(ServletContext servletContext) {
    try {
      Properties properties = new Properties();
      // 1. first META-INF/freemarker.properties
      List<URL> urls = ClassLoaders.getResources("META-INF/freemarker.properties", getClass());
      for (URL url : urls)
        properties.putAll(getProperties(url));

      // 2. second global freemarker.properties
      urls = ClassLoaders.getResources("freemarker.properties", getClass());
      for (URL url : urls)
        properties.putAll(getProperties(url));

      // 3. system properties
      Properties sysProps = System.getProperties();
      Enumeration<?> sysKeys = sysProps.propertyNames();
      while (sysKeys.hasMoreElements()) {
        String key = (String) sysKeys.nextElement();
        String value = sysProps.getProperty(key);
        if (key.startsWith("freemarker.")) {
          properties.put(Strings.substringAfter(key, "freemarker."), value);
        }
      }

      // 4 add setting and log info
      StringBuilder sb = new StringBuilder();
      @SuppressWarnings("rawtypes")
      List keys = CollectUtils.newArrayList(properties.keySet());
      Collections.sort(keys);
      for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
        String key = iter.next();
        String value = (String) properties.get(key);
        if (null != key && null != value) {
          addSetting(key, value);
          sb.append(key).append("->").append(value);
          if (iter.hasNext()) sb.append(',');
        }
      }
      // 5 support beangle profiles
      String profiles = System.getProperty("beangle.cdi.profiles");
      if (Strings.contains(profiles, "dev")) {
        config.setTemplateUpdateDelayMilliseconds(0);
      }
      logger.info("Freemarker properties:{} ", sb);
    } catch (TemplateException e) {
      logger.error("Error while setting freemarker.properties", e);
    }
  }
1090553
Object processVariableLists(Object rawValue, ExtendedAttributeDefinition attributeDef,
                                EvaluationContext context, boolean ignoreWarnings) throws ConfigEvaluatorException {
        if (attributeDef != null && !attributeDef.resolveVariables())
            return rawValue;

        if (rawValue instanceof List) {
            List<Object> returnList = new ArrayList<Object>();
            List<Object> values = (List<Object>) rawValue;
            for (Object o : values) {
                Object processed = processVariableLists(o, attributeDef, context, ignoreWarnings);
                if (processed instanceof List)
                    returnList.addAll((List<Object>) processed);
                else
                    returnList.add(processed);
            }
            return returnList;
        } else if (rawValue instanceof String) {
            // Look for functions of the form ${list(variableName)} first
            Matcher matcher = XMLConfigConstants.VAR_LIST_PATTERN.matcher((String) rawValue);
            if (matcher.find()) {
                String var = matcher.group(1);
                String rep = getProperty(var, context, ignoreWarnings, true);
                return rep == null ? rawValue : MetaTypeHelper.parseValue(rep);
            } else {
                return rawValue;
            }
        } else {
            return rawValue;
        }

    }
1296717
private void gatherProperties(List<VariableElement> fields, Element element) {

    TypeElement typeElement = (TypeElement) element;
    TypeMirror superclass = typeElement.getSuperclass();
    Element mappedSuper = typeUtils.asElement(superclass);
    if (isMappedSuperOrInheritance(mappedSuper)) {
      gatherProperties(fields, mappedSuper);
    }

    List<VariableElement> allFields = ElementFilter.fieldsIn(element.getEnclosedElements());
    for (VariableElement field : allFields) {
      if (!ignoreField(field)) {
        fields.add(field);
      }
    }
  }
1288548
public JRecordExtractor<T, Example>
  extractWithSubsetSettingsExample(String settings) {
    return new JRecordExtractor<>(JavaOps.extractWithSubsetSettingsExample(self, settings));
  }
256750
def restoreSettings(self, settings):
        
        val = unwrapVariant(settings.value('format'))
        if val:
            self.setFormatText(val)
        
        levels = unwrapVariant(settings.value('levels'))
        if levels:
            self.setActiveLevels(map(int, levels.split(',')))
        
        logger_levels = unwrapVariant(settings.value('loggerLevels'))
        if logger_levels:
            for key in logger_levels.split(','):
                logger, lvl = key.split(':')
                lvl = int(lvl)
                self.setLoggerLevel(logger, lvl)
28733
static MavenSettings parseMavenSettings(File settingsFile) throws IOException {
		MavenSettings settings = new MavenSettings();
		try {
			DocumentBuilder xmlBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
			Document xmlDoc = xmlBuilder.parse(settingsFile);
			
			NodeList mirrorList = xmlDoc.getDocumentElement().getElementsByTagName("mirror");
			for (int i = 0; i < mirrorList.getLength(); i++) {
				Element mirror = (Element)mirrorList.item(i);
				String url = mirror.getElementsByTagName("url").item(0).getTextContent().trim();
				String mirrorOf = mirror.getElementsByTagName("mirrorOf").item(0).getTextContent().trim();
				if (mirrorOf.equals("central") || mirrorOf.contains("*")) settings.mMirrorUrl = url;
			}
			
			NodeList proxyList = xmlDoc.getDocumentElement().getElementsByTagName("proxy");
			for (int i = 0; i < proxyList.getLength(); i++) {
				Node proxy = proxyList.item(i);
				Node host = null;
				Node port = null;
				for (int j = 0; j < proxy.getChildNodes().getLength(); j++) {
					Node n = proxy.getChildNodes().item(j);
					if (n.getNodeName().equals("host")) host = n;
					if (n.getNodeName().equals("port")) port = n;
				}
				if (host != null) {
					settings.mProxyHost = host.getTextContent().trim();
					if (port != null) settings.mProxyPort = Integer.parseInt(port.getTextContent().trim());
					break;
				}
			}
		}
		catch (Exception e) {
			throw new IOException(e);
		}
		return settings;
	}
1171298
private String extractPrefix(ApplicationContext context,
			ConfigurationBeanFactoryMetadata beanFactoryMetaData, String beanName) {
		ConfigurationProperties annotation = context.findAnnotationOnBean(beanName,
				ConfigurationProperties.class);
		if (beanFactoryMetaData != null) {
			ConfigurationProperties override = beanFactoryMetaData
					.findFactoryAnnotation(beanName, ConfigurationProperties.class);
			if (override != null) {
				// The @Bean-level @ConfigurationProperties overrides the one at type
				// level when binding. Arguably we should render them both, but this one
				// might be the most relevant for a starting point.
				annotation = override;
			}
		}
		return annotation.prefix();
	}
1044278
protected void extractConfigValues(Map<String, Object> yaml, List<ConfigMetadataNode> configs) {
		for (final ConfigMetadataNode config : configs) {
			Configs.defineConfig(yaml, config, this.injector);
		}
	}
364000
public JRecordExtractor<T, FloatSparseArray>
  extractWithSubsetSettingsFloatSparseArray(String settings) {
    return new JRecordExtractor<>(JavaOps.extractWithSubsetSettingsFloatSparseArray(self, settings));
  }
832782
private ProvisioningFeatureDefinition getCachedFeature(String featureName) {
        List<ProvisioningFeatureDefinition> featureList = symbolicNameToFeature.get(featureName);

        if (featureList == null) {
            featureName = publicNameToSymbolicName.get(featureName.toLowerCase());
            if (featureName != null) {
                featureList = symbolicNameToFeature.get(featureName);
            }
        }

        if (featureList == null || featureList.isEmpty()) {
            return null;
        }

        return getPreferredVersion(featureName, featureList);
    }
29357
public JFeatureExtractor<T> extract(List<T> input) {
    return new JFeatureExtractor<>(JavaOps.extract(self, input));
  }
934629
@Override
    public void parse(ClassInfo.Builder builder) throws InvalidClassFileFormatException {
        parse((ClassNameAndSuperclassInfo.Builder) builder);

        final List<FieldDescriptor> fieldDescriptorList = new LinkedList<>();
        final List<MethodDescriptor> methodDescriptorList = new LinkedList<>();
        final TreeSet<ClassDescriptor> referencedClassSet = new TreeSet<>();
        javaClass.accept(new AnnotationVisitor() {
            @Override
            public void visit(Method obj) {
                methodDescriptorList.add(parseMethod(obj));
            }

            @Override
            public void visit(Field obj) {
                fieldDescriptorList.add(parseField(obj));
            }

            @Override
            public void visit(ConstantClass obj) {
                @SlashedClassName
                String className = obj.getBytes(javaClass.getConstantPool());
                if (className.indexOf('[') >= 0) {
                    ClassParser.extractReferencedClassesFromSignature(referencedClassSet, className);
                } else if (ClassName.isValidClassName(className)) {
                    referencedClassSet.add(DescriptorFactory.instance().getClassDescriptor(className));
                }
            }

            @Override
            public void visit(ConstantNameAndType obj) {
                String signature = obj.getSignature(javaClass.getConstantPool());
                ClassParser.extractReferencedClassesFromSignature(referencedClassSet, signature);
            }
        });

    }
194799
private Set<String> readFeatureNameList(String line) {
        String[] parts = FeatureDefinitionUtils.installedFeatureSplitPattern.split(line);
        return parts.length > 0 ? Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(parts))) : Collections.<String> emptySet();
    }