/** Extracts and returns the Exif property list from a standard * IFD property header. */ public List exifProps (Property pHeader) { try { Property[] pArr = (Property []) pHeader.getValue (); Property entries = pArr[2]; return (List) entries.getValue (); } catch (Exception e) { // We could get caught here if we somehow tried to get // the Exif properties from something that wasn't a // standard property header. return null; } }
/** Set a property indexed by component. * If a property for that component doesn't already * exist, it is created. <code>prop</code> is then * added to the property list of that property. */ public void setCompProperty (int idx, Property prop) { if (_components != null && _components.length > idx) { if (_components[idx] == null) { // Have to create the component property _components[idx] = new Property ("Component", PropertyType.PROPERTY, PropertyArity.LIST, new LinkedList ()); } List pList = (List) _components[idx].getValue (); pList.add (prop); } }
arity == PropertyArity.MAP) { if (arity == PropertyArity.SET) { Set<?> set = (Set<?>) pProp.getValue (); iter = set.iterator (); Map<?, ?> map = (Map<?, ?>) pProp.getValue (); iter = map.values().iterator (); List<?> list = (List<?>) pProp.getValue (); iter = list.iterator (); dateArray = (java.util.Date []) pProp.getValue (); n = dateArray.length; objArray = (Object []) pProp.getValue (); n = objArray.length; rationalArray = (Rational []) pProp.getValue (); n = rationalArray.length; propArray = (Property []) pProp.getValue (); n = propArray.length;
/** Finishes any property under construction. This is called * when an end element is encountered. */ public void finishPropUnderConstruction () { if (_propUnderConstruction != null) { String name = _propUnderConstruction.getName (); if ("abbr".equals(name)) { addAbbr (_propUnderConstruction); } else if ("title".equals (name)) { _title = (String) _propUnderConstruction.getValue (); } _propUnderConstruction = null; } } }
{ Set<?> s = (Set<?>) p.getValue (); PropertyType ptyp = p.getType (); Iterator<?> iter = s.iterator (); while (iter.hasNext ()) { Object item = iter.next (); if (ptyp == PropertyType.PROPERTY) { node.add (propToNode ((Property) item)); } else if (ptyp == PropertyType.NISOIMAGEMETADATA) { node.add (nisoToNode ((NisoImageMetadata) item)); } else { // Simple objects just need a leaf. node.add (new DefaultMutableTreeNode (item, false)); } } }
{ List<Object> l = (List<Object>) p.getValue (); PropertyType ptyp = p.getType (); for (Object item : l) { if (ptyp == PropertyType.PROPERTY) { node.add (propToNode ((Property) item)); } else if (ptyp == PropertyType.NISOIMAGEMETADATA) { node.add (nisoToNode ((NisoImageMetadata) item)); } else { // Simple objects just need a leaf. node.add (new DefaultMutableTreeNode (item, false)); } } }
{ Map<?, ?> m = (Map<?, ?>) p.getValue (); PropertyType ptyp = p.getType (); //Iterator iter = m.values ().iterator (); Iterator<?> iter = m.keySet ().iterator (); while (iter.hasNext ()) { DefaultMutableTreeNode itemNode; String key = (String) iter.next (); Object item = m.get (key); //Object item = iter.next (); if (ptyp == PropertyType.PROPERTY) { itemNode = (propToNode ((Property) item)); } else if (ptyp == PropertyType.NISOIMAGEMETADATA) { itemNode = (nisoToNode ((NisoImageMetadata) item)); } else { // Simple objects just need a leaf. itemNode = (new DefaultMutableTreeNode (item, true)); } node.add (itemNode); // Add a subnode for the key itemNode.setAllowsChildren (true); itemNode.add (new DefaultMutableTreeNode ("Key: " + key, false)); } } /* Function for turning the AES metadata into a subtree. */
while (iter.hasNext()) { Property p = iter.next(); String s = (String) p.getValue(); if (s.equals(filterStr)) { unique = false;
try { if (arity.equals (PropertyArity.SET)) { Set propSet = (Set) property.getValue (); return (propSet.isEmpty()); List propList = (List) property.getValue (); return (propList.isEmpty()); Map propMap = (Map) property.getValue (); return (propMap.isEmpty()); boolArray = (boolean []) property.getValue (); n = boolArray.length; byteArray = (byte []) property.getValue (); n = byteArray.length; charArray = (char []) property.getValue (); n = charArray.length; dateArray = (java.util.Date []) property.getValue (); n = dateArray.length; doubleArray = (double []) property.getValue (); n = doubleArray.length; floatArray = (float []) property.getValue (); n = floatArray.length;
PropertyType typ = p.getType (); if (typ == PropertyType.INTEGER) { int[] ar = (int []) pVal;
private void showScalarProperty (Property property, String margin) { PropertyType type = property.getType (); if (PropertyType.PROPERTY.equals (type)) { _writer.println (); Property prop = (Property) property.getValue (); showProperty (prop, prop.getName (), margin + " "); //_writer.println (); // Does this improve things? } else if (PropertyType.NISOIMAGEMETADATA.equals (type)) { showNisoImageMetadata ((NisoImageMetadata) property.getValue (), margin + " ", _je.getShowRawFlag ()); } else if (PropertyType.AESAUDIOMETADATA.equals (type)) { showAESAudioMetadata ((AESAudioMetadata) property.getValue (), margin + " ", _je.getShowRawFlag ()); } else if (PropertyType.TEXTMDMETADATA.equals(type)) { showTextMDMetadata((TextMDMetadata) property.getValue(), margin + " ", _je.getShowRawFlag ()); } else { _writer.println (property.getValue ().toString ()); } }
boolean valueIsTextMD = PropertyType.TEXTMDMETADATA.equals(type); Map propmap = (Map) property.getValue (); Set keys = propmap.keySet(); Iterator propiter = keys.iterator();
boolean valueIsTextMD = PropertyType.TEXTMDMETADATA.equals(type); List list = (List) property.getValue ();
boolean valueIsTextMD = PropertyType.TEXTMDMETADATA.equals(type); Set propset = (Set) property.getValue (); Iterator propiter = propset.iterator (); boolean first = true;
boolArray = (boolean []) property.getValue (); n = boolArray.length; byteArray = (byte []) property.getValue (); n = byteArray.length; charArray = (char []) property.getValue (); n = charArray.length; dateArray = (java.util.Date []) property.getValue (); n = dateArray.length; doubleArray = (double []) property.getValue (); n = doubleArray.length; floatArray = (float []) property.getValue (); n = floatArray.length; intArray = (int []) property.getValue (); n = intArray.length; longArray = (long []) property.getValue (); n = longArray.length; objArray = (Object []) property.getValue (); n = objArray.length; shortArray = (short []) property.getValue (); n = shortArray.length;
/** * Extract the content value associated with a given httpEquiv. * @param prop List containing the description of the meta tag * @param httpEquivValue the httpEquiv to consider * @return the content value */ public String extractHttpEquivValue(Property prop, String httpEquivValue) { if (httpEquivValue == null) return null; String value = null; Property httpEquiv = prop.getByName("Httpequiv"); if (httpEquiv != null && PropertyArity.SCALAR.equals(httpEquiv.getArity()) && PropertyType.STRING.equals(httpEquiv.getType()) ) { String val = (String)httpEquiv.getValue(); if (httpEquivValue.equalsIgnoreCase(val)) { // Look for charset in the Content property Property content = prop.getByName("Content"); if (content != null && PropertyArity.SCALAR.equals(content.getArity()) && PropertyType.STRING.equals(content.getType()) ) { value = (String)content.getValue(); } } } return value; }
Object pValue = pProp.getValue (); if (arity == PropertyArity.SCALAR) { if (typ == PropertyType.NISOIMAGEMETADATA) {
extractExifNisoData((NisoImageMetadata) nisoProp.getValue());
WaveStrings.COMPRESSION_FORMAT, WaveStrings.COMPRESSION_INDEX); module.addWaveProperty(prop); String compName = (String)prop.getValue();