Parse the "@attribute" section of the ARFF file.

@param br Input
@param names List (to fill) of attribute names
@param types List (to fill) of attribute types
@throws IOException
5780
private void parseAttributeStatements(BufferedReader br, ArrayList<String> names, ArrayList<String> types) throws IOException {
    String line;
    // Load attribute metadata
    while(true) {
      line = br.readLine();
      if(line == null) {
        throw new AbortException(ARFF_HEADER_DATA + " not found in file.");
      }
      // Skip comments and empty lines
      if(ARFF_COMMENT.reset(line).matches() || EMPTY.reset(line).matches()) {
        continue;
      }
      // Break on data statement to continue
      if(ARFF_HEADER_DATA.reset(line).matches()) {
        break;
      }
      // Expect an attribute specification
      Matcher matcher = ARFF_HEADER_ATTRIBUTE.reset(line);
      if(matcher.matches()) {
        String name = matcher.group(1);
        if(name.charAt(0) == '\'' && name.charAt(name.length() - 1) == '\'') {
          name = name.substring(1, name.length() - 1);
        }
        else if(name.charAt(0) == '"' && name.charAt(name.length() - 1) == '"') {
          name = name.substring(1, name.length() - 1);
        }
        String type = matcher.group(2);
        names.add(name);
        types.add(type);
        // logger.warning("Attribute name: " + name + " type: " + type);
        continue;
      }
      throw new AbortException("Unrecognized line: " + line);
    }
    assert (names.size() == types.size());
  }
565879
ImmutableMap<String, Object> readAttributes(File file, String attributes) {
    state.checkOpen();
    return this.attributes.readAttributes(file, attributes);
  }
1012931
public static function attributes( $attributes, $name = null, $type = null, $options = null ) {

		$attributes = (array) apply_filters( "pods_form_ui_field_{$type}_attributes", $attributes, $name, $options );

		foreach ( $attributes as $attribute => $value ) {
			if ( null === $value ) {
				continue;
			}

			echo ' ' . esc_attr( (string) $attribute ) . '="' . esc_attr( (string) $value ) . '"';
		}
	}
1251042
private void readInstance(StreamTokenizer tokenizer, AttributeDataset data, Attribute[] attributes) throws IOException, ParseException {
        double[] x = responseIndex >= 0 ? new double[attributes.length - 1] : new double[attributes.length];
        double y = Double.NaN;
        
        // Get values for all attributes.
        for (int i = 0, k = 0; i < attributes.length; i++) {
            // Get next token
            if (i > 0) {
                getNextToken(tokenizer);
            }

            if (i == responseIndex) {
                if (tokenizer.ttype == '?') {
                    y = Double.NaN;
                } else {
                    y = attributes[i].valueOf(tokenizer.sval);
                }
            } else {
                if (tokenizer.ttype == '?') {
                    x[k++] = Double.NaN;
                } else {
                    x[k++] = attributes[i].valueOf(tokenizer.sval);
                }
            }
        }

        if (Double.isNaN(y)) data.add(x); else data.add(x, y);
    }
88785
private static void parseAST(String[] srcFiles, Charset srcCharset,
            String[] classPathEntries, FileASTRequestor requestor) {
        ASTParser parser = ASTParser.newParser(AST.JLS8);
        Map<String, String> options = JavaCore.getOptions();
        JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
        parser.setCompilerOptions(options);
        parser.setKind(ASTParser.K_COMPILATION_UNIT);
        parser.setResolveBindings(true);
        parser.setBindingsRecovery(true);
        parser.setEnvironment(classPathEntries, null, null, true);
        String[] srcEncodings = new String[srcFiles.length];
        for (int i = 0; i < srcEncodings.length; i++) {
            srcEncodings[i] = srcCharset.name();
        }
        parser.createASTs(
                srcFiles, srcEncodings, new String[]{}, requestor, null);
    }
440476
protected void parseAttributes() {
        burnWhitespaces();
        attribute = null;
        while (reader.hasNextCharacter()) {
            char character = reader.peekCharacter();
            if (Strings.isNewLine(character) && (attribute != null || Strings.isNotEmpty(builder))) {
                throwException("Expecting line end marker: '" + lineEnd + "'.");
            }
            character = next();
            if (Strings.isNewLine(character) && (attribute != null || Strings.isNotEmpty(builder))) {
                // Needs double check, possible comment along the way.
                throwException("Expecting line end marker: '" + lineEnd + "'.");
            } else if (character == blockClosing) {
                if (attribute != null || Strings.isNotEmpty(builder)) {
                    throwException("Unexpected tag close.");
                }
                return;
            } else if (Strings.isWhitespace(character) && attribute == null) {
                continue;
            } else if (character == separator && attribute == null) {
                addAttributeName();
                continue;
            } else if (character == lineEnd) {
                if (attribute == null) {
                    throwException("Found unexpected line end marker: '" + lineEnd + "'. Is separator (" + separator
                            + ") missing?");
                }
                addAttribute();
            } else {
                builder.append(character);
            }
        }
    }
246791
public void setTextAttributes(byte[] fields, Hashtable attrib) {
        for (byte field : fields) {
            getFieldInfos(field).m_textAttributes = attrib;
        }
		notifyListeners();
	}
1239266
public static void parseCommonStoreAttributes(XMLExtendedStreamReader reader, int i,
                                                 StoreConfigurationBuilder<?, ?> builder) throws XMLStreamException {
      ParseUtils.requireNoNamespaceAttribute(reader, i);
      String value = reader.getAttributeValue(i);
      org.infinispan.tools.config.v6.Attribute attribute = org.infinispan.tools.config.v6.Attribute.forName(reader.getAttributeLocalName(i));
      switch (attribute) {
         case FETCH_PERSISTENT_STATE:
            builder.fetchPersistentState(Boolean.parseBoolean(value));
            break;
         case IGNORE_MODIFICATIONS:
            builder.ignoreModifications(Boolean.parseBoolean(value));
            break;
         case PURGE_ON_STARTUP:
            builder.purgeOnStartup(Boolean.parseBoolean(value));
            break;
         default:
            throw ParseUtils.unexpectedAttribute(reader, i);
      }
   }
696076
public void setAttributeFieldNames(String fieldNames) {
		String[] names = fieldNames.split(",");
		if (this.attributeFieldInfos == null) {
			this.attributeFieldInfos = new ArrayList<JmxAttributeFieldInfo>();
		}
		for (int i = 0; i < names.length; i++) {
			this.attributeFieldInfos.add(new JmxAttributeFieldInfo(names[i]));
		}
	}
852810
private void parseAttributes(AttributeSet attrs) {
        if (attrs != null) {
            TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.ExpandableMenuOverlay, 0, 0);
            try {
                // button metrics
                mainButtonSize = a.getFloat(R.styleable.ExpandableMenuOverlay_mainButtonSize, DEFAULT_MAIN_BUTTON_SIZE);
                otherButtonSize = a.getFloat(R.styleable.ExpandableMenuOverlay_otherButtonSize, DEFAULT_OTHER_BUTTON_SIZE);
                bottomPadding = a.getFloat(R.styleable.ExpandableMenuOverlay_bottomPad, DEFAULT_BOTTOM_PADDING);
                buttonDistanceY = a.getFloat(R.styleable.ExpandableMenuOverlay_distanceY, DEFAULT_BUTTON_DISTANCE_Y);
                buttonDistanceX = a.getFloat(R.styleable.ExpandableMenuOverlay_distanceX, DEFAULT_BUTTON_DISTANCE_X);

                // button resources
                mCloseBtn.setBackgroundResource(a.getResourceId(R.styleable.ExpandableMenuOverlay_closeButtonSrc, 0));
                mLeftBtn.setBackgroundResource(a.getResourceId(R.styleable.ExpandableMenuOverlay_leftButtonSrc, 0));
                mRightBtn.setBackgroundResource(a.getResourceId(R.styleable.ExpandableMenuOverlay_rightButtonSrc, 0));
                mMidBtn.setBackgroundResource(a.getResourceId(R.styleable.ExpandableMenuOverlay_midButtonSrc, 0));

                // button text
                mLeftText.setText(a.getResourceId(R.styleable.ExpandableMenuOverlay_leftButtonText, R.string.empty));
                mRightText.setText(a.getResourceId(R.styleable.ExpandableMenuOverlay_rightButtonText, R.string.empty));
                mMidText.setText(a.getResourceId(R.styleable.ExpandableMenuOverlay_midButtonText, R.string.empty));

            } finally {
                a.recycle();
            }
        }
    }
682288
private void scanField(InputStream is)
    throws IOException
  {
    // int accessFlags = readShort();
    // int nameIndex = readShort();
    // int descriptorIndex = readShort();
    
    is.skip(6);

    int attributesCount = readShort(is);

    for (int i = 0; i < attributesCount; i++) {
      scanAttributeForAnnotation(is);
    }
  }
279139
@SuppressWarnings("PMD.UnnecessaryCaseChange")
    private void addAttributes(List<String> pAttrs, Method pMethod) {
        String name = pMethod.getName();
        for (String pref : GETTER_PREFIX) {
            if (name.startsWith(pref) && name.length() > pref.length()
                    && pMethod.getParameterTypes().length == 0) {
                int len = pref.length();
                String firstLetter = name.substring(len,len+1);
                // Only for getter compliant to the beans conventions (first letter after prefix is upper case)
                if (firstLetter.toUpperCase().equals(firstLetter)) {
                    String attribute =
                            new StringBuffer(firstLetter.toLowerCase()).
                                    append(name.substring(len+1)).toString();
                    pAttrs.add(attribute);
                }
            }
        }
    }
1141559
public void setAttributes(java.util.Collection<AttributeType> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<AttributeType>(attributes);
    }
475091
public static void parseCommonStoreAttributes(XMLExtendedStreamReader reader, StoreConfigurationBuilder builder, String attributeName, String value, int i) throws XMLStreamException {
      switch (Attribute.forName(attributeName)) {
         case FETCH_PERSISTENT_STATE:
            builder.fetchPersistentState(Boolean.valueOf(value));
            break;
         case IGNORE_MODIFICATIONS:
            builder.ignoreModifications(Boolean.valueOf(value));
            break;
         case PURGE_ON_STARTUP:
            builder.purgeOnStartup(Boolean.valueOf(value));
            break;
         case PRELOAD:
            builder.preload(Boolean.parseBoolean(value));
            break;
         case SHARED:
            builder.shared(Boolean.parseBoolean(value));
            break;
         default:
            throw ParseUtils.unexpectedAttribute(reader, i);
      }
   }
1002530
public static AttributeList setAttributes(String name, HashMap attributes) throws JMException
   {
      MBeanServer server = getMBeanServer();
      ObjectName objName = new ObjectName(name);
      MBeanInfo info = server.getMBeanInfo(objName);
      MBeanAttributeInfo[] attributesInfo = info.getAttributes();
      AttributeList newAttributes = new AttributeList();

      for (int a = 0; a < attributesInfo.length; a++)
      {
         MBeanAttributeInfo attrInfo = attributesInfo[a];
         String attrName = attrInfo.getName();

         if (!attributes.containsKey(attrName))
            continue;

         String value = (String) attributes.get(attrName);
         if (value.equals("null") && server.getAttribute(objName, attrName) == null)
         {
            if (trace)
               log.trace("ignoring 'null' for " + attrName);
            continue;
         }

         String attrType = attrInfo.getType();
         Attribute attr = null;
         try
         {
            Object realValue = PropertyEditors.convertValue(value, attrType);
            attr = new Attribute(attrName, realValue);
         }
         catch (ClassNotFoundException e)
         {
            if (trace)
               log.trace("Failed to load class for attribute: " + attrType, e);
            throw new ReflectionException(e, "Failed to load class for attribute: " + attrType);
         }
         catch (IntrospectionException e)
         {
            if (trace)
               log.trace("Skipped setting attribute: " + attrName + 
                         ", cannot find PropertyEditor for type: " + attrType);
            continue;
         }

         server.setAttribute(objName, attr);
         newAttributes.add(attr);
      }

      return newAttributes;
   }
616864
static void writeAttribute(Writer out, String name, String value) throws IOException {
        out.write('"');
        out.write(name);
        out.write("\":");
        out.write(quote(value));
    }
1331012
public static void addOrSetAttribute(final AttributesImpl atts, final String uri, final String localName,
            final String qName, final String type, final String value) {
        final int i = atts.getIndex(qName);
        if (i != -1) {
            atts.setAttribute(i, uri, localName, qName, type, value);
        } else {
            atts.addAttribute(uri, localName, qName, type, value);
        }
    }