Creates TLV element with byte array content.
TLV element nonCritical and forwarded flags are set to false.

@param type TLV element type.
@param value value to be the content of the TLV element.

@return {@link TLVElement}

@throws TLVParserException
557865
public static TLVElement create(int type, byte[] value) throws TLVParserException {
        TLVElement element = create(type);
        element.setContent(value);
        return element;
    }
561862
private Typeface parseTypeface(final int value) {
        switch (value) {
            case TYPEFACE_SANS_SERIF_VALUE:
                return Typeface.SANS_SERIF;
            case TYPEFACE_SERIF_VALUE:
                return Typeface.SERIF;
            case TYPEFACE_MONOSPACE_VALUE:
                return Typeface.MONOSPACE;
            default:
                return Typeface.DEFAULT;
        }
    }
1016599
public <X> T value(X value, String subType) throws IOException {
		return text(stringifierFactory.toString(value, subType));
	}
446110
protected function createNodeByValueAndType($value, $type)
    {
        /*
         * URI
         */
        if ('uri' == $type) {
            return $this->nodeFactory->createNamedNode($value);

        /*
         * Any Pattern
         */
        } elseif ('var' == $type) {
            return $this->nodeFactory->createAnyPattern();

        /*
         * Typed Literal or Literal
         */
        } elseif ('typed-literal' == $type || 'literal' == $type) {
            return $this->nodeFactory->createLiteral($value);

        /*
         * Unknown type
         */
        } else {
            throw new \Exception('Unknown type given: '.$type);
        }
    }
564697
public static MediaType fromString(String value) {
        if (value == null) {
            throw new NullPointerException("value");
        }
        List<ParameterizedHeaderWithValue> headerValues = ParameterizedHeaderWithValue.fromString(value);
        if (headerValues.isEmpty()) {
            throw new IllegalArgumentException("The value '" + value + "' did not contain a valid header value");
        }
        ParameterizedHeaderWithValue v = headerValues.get(0);
        String[] split = v.value().split("/");
        if (split.length != 2) {
            throw new IllegalArgumentException("Media types must be in the format 'type/subtype'; this is inavlid: '" + v.value() + "'");
        }
        return new MediaType(split[0], split[1], v.parameters());
    }
257132
@SuppressWarnings("unchecked") private Object formatType(DataType type, Object value)
   {
      switch (type)
      {
         case DATE:
         {
            value = formatDateTime(value);
            break;
         }

         case CURRENCY:
         {
            value = formatCurrency((Number) value);
            break;
         }

         case UNITS:
         {
            value = formatUnits((Number) value);
            break;
         }

         case PERCENTAGE:
         {
            value = formatPercentage((Number) value);
            break;
         }

         case ACCRUE:
         {
            value = formatAccrueType((AccrueType) value);
            break;
         }

         case CONSTRAINT:
         {
            value = formatConstraintType((ConstraintType) value);
            break;
         }

         case WORK:
         case DURATION:
         {
            value = formatDuration(value);
            break;
         }

         case RATE:
         {
            value = formatRate((Rate) value);
            break;
         }

         case PRIORITY:
         {
            value = formatPriority((Priority) value);
            break;
         }

         case RELATION_LIST:
         {
            value = formatRelationList((List<Relation>) value);
            break;
         }

         case TASK_TYPE:
         {
            value = formatTaskType((TaskType) value);
            break;
         }

         default:
         {
            break;
         }
      }

      return (value);
   }
767238
public static String typeValueString(final Object value) {
        StringBuilder sb = new StringBuilder(valueString(value));
        return sb.append(" :").append(typeString(value)).toString();
    }
809925
public Binder append(Class<?> type, Object value) {
        return new Binder(this, new Insert(type().parameterCount(), new Class[]{type}, value));
    }
796698
public Element append(ICalDataType dataType, String value) {
		String dataTypeStr = toLocalName(dataType);
		return append(dataTypeStr, value);
	}
575233
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "valueComponents")
    public JAXBElement<ValueArrayPropertyType> createValueComponents(ValueArrayPropertyType value) {
        return new JAXBElement<ValueArrayPropertyType>(_ValueComponents_QNAME, ValueArrayPropertyType.class, null, value);
    }
653527
@XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "rights", scope = EntryType.class)
    public JAXBElement<TextType> createEntryTypeRights(TextType value) {
        return new JAXBElement<TextType>(ENTRY_TYPE_RIGHTS_QNAME,
                TextType.class, EntryType.class, value);
    }
150668
protected static <T> T checkType(String view, String attribute, Object value, Class<T> type) {
    checkNotNull(value);
    if (type.isInstance(value)) {
      return type.cast(value);
    }

    throw invalidType(view, attribute, value, type);
  }
753123
@XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "title", scope = FeedType.class)
    public JAXBElement<TextType> createFeedTypeTitle(TextType value) {
        return new JAXBElement<TextType>(ENTRY_TYPE_TITLE_QNAME, TextType.class,
                FeedType.class, value);
    }
1369733
public static TLVElement create(int type, Date value) throws TLVParserException {
        TLVElement element = create(type);
        element.setDateContent(value);
        return element;
    }
59395
private Object[] convertToSingleElementArray(Object value) {
		final Object[] singleElementArray = ArrayUtil.newArray(targetComponentType, 1);
		singleElementArray[0] = ConverterRegistry.getInstance().convert(targetComponentType, value);
		return singleElementArray;
	}
893345
@XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "source", scope = EntryType.class)
    public JAXBElement<TextType> createEntryTypeSource(TextType value) {
        return new JAXBElement<TextType>(ENTRY_TYPE_SOURCE_QNAME,
                TextType.class, EntryType.class, value);
    }
1294606
private static void parseValueElement(Element element,
			ConfigurableEmitter.Value value) {
		if (element == null) {
			return;
		}

		String type = element.getAttribute("type");
		String v = element.getAttribute("value");

		if (type == null || type.length() == 0) {
			// support for old style which did not write the type
			if (value instanceof SimpleValue) {
				((SimpleValue) value).setValue(Float.parseFloat(v));
			} else if (value instanceof RandomValue) {
				((RandomValue) value).setValue(Float.parseFloat(v));
			} else {
				Log.warn("problems reading element, skipping: " + element);
			}
		} else {
			// type given: this is the new style
			if (type.equals("simple")) {
				((SimpleValue) value).setValue(Float.parseFloat(v));
			} else if (type.equals("random")) {
				((RandomValue) value).setValue(Float.parseFloat(v));
			} else if (type.equals("linear")) {
				String min = element.getAttribute("min");
				String max = element.getAttribute("max");
				String active = element.getAttribute("active");

				NodeList points = element.getElementsByTagName("point");

				ArrayList curve = new ArrayList();
				for (int i = 0; i < points.getLength(); i++) {
					Element point = (Element) points.item(i);

					float x = Float.parseFloat(point.getAttribute("x"));
					float y = Float.parseFloat(point.getAttribute("y"));

					curve.add(new Vector2f(x, y));
				}

				((LinearInterpolator) value).setCurve(curve);
				((LinearInterpolator) value).setMin(Integer.parseInt(min));
				((LinearInterpolator) value).setMax(Integer.parseInt(max));
				((LinearInterpolator) value).setActive("true".equals(active));
			} else {
				Log.warn("unkown type detected: " + type);
			}
		}
	}