Provide a getter for custom properties, to match the add and contains methods already there
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1622252 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6ac5bb3fbd
commit
d65693cb08
@ -285,6 +285,7 @@ public class POIXMLProperties {
|
|||||||
public org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.CTProperties getUnderlyingProperties() {
|
public org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.CTProperties getUnderlyingProperties() {
|
||||||
return props.getProperties();
|
return props.getProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -393,5 +394,24 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the custom property with this name, or null if none exists.
|
||||||
|
*
|
||||||
|
* You will need to test the various isSetX methods to work out
|
||||||
|
* what the type of the property is, before fetching the
|
||||||
|
* appropriate value for it.
|
||||||
|
*
|
||||||
|
* @param name the name of the property to fetch
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public CTProperty getProperty(String name) {
|
||||||
|
for(CTProperty p : props.getProperties().getPropertyArray()){
|
||||||
|
if(p.getName().equals(name)) {
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user