/** * Parse an AttributeType/AttributeValue * * @param line The line to parse * @return the parsed Attribute */ public static Attribute parseAttributeValue( String line ) { int colonIndex = line.indexOf( ':' ); if ( colonIndex != -1 ) { String attributeType = line.substring( 0, colonIndex ); Object attributeValue = parseSimpleValue( line, colonIndex ); // Create an attribute if ( attributeValue instanceof String ) { return new DefaultAttribute( attributeType, ( String ) attributeValue ); } else { return new DefaultAttribute( attributeType, ( byte[] ) attributeValue ); } } else { return null; } }
/** * Parse an AttributeType/AttributeValue * * @param line The line to parse * @return the parsed Attribute */ public static Attribute parseAttributeValue( String line ) { int colonIndex = line.indexOf( ':' ); if ( colonIndex != -1 ) { String attributeType = line.substring( 0, colonIndex ); Object attributeValue = parseSimpleValue( line, colonIndex ); // Create an attribute if ( attributeValue instanceof String ) { return new DefaultAttribute( attributeType, ( String ) attributeValue ); } else { return new DefaultAttribute( attributeType, ( byte[] ) attributeValue ); } } else { return null; } }
/** * Parse an AttributeType/AttributeValue * * @param line The line to parse * @return the parsed Attribute */ public static Attribute parseAttributeValue( String line ) { int colonIndex = line.indexOf( ':' ); if ( colonIndex != -1 ) { String attributeType = line.substring( 0, colonIndex ); Object attributeValue = parseSimpleValue( line, colonIndex ); // Create an attribute if ( attributeValue instanceof String ) { return new DefaultAttribute( attributeType, ( String ) attributeValue ); } else { return new DefaultAttribute( attributeType, ( byte[] ) attributeValue ); } } else { return null; } }