/** * @param name * @return */ public String getPropertyValueByName(String name) { if (properties != null) { for (VLViewPropertyXML propertyXML : properties) { if (propertyXML.getName().equalsIgnoreCase(name)) { return propertyXML.getValue(); } } } return null; }
public boolean getBooleanProperty(String name) { boolean result = true; if (properties != null && properties.getProperties() != null) { for (final VLViewPropertyXML property : properties.getProperties()) { if (property.getName().equals(name)) { try { result = property.getValue() == null && StringUtils.isBlank(property.getValue()) && property.getValue().equalsIgnoreCase("true"); } catch (final Exception e) { } } } } return result; }
public boolean getBooleanProperty(String name, boolean defautVal) { boolean result = defautVal; if (properties != null && properties.getProperties() != null) { for (final VLViewPropertyXML property : properties.getProperties()) { if (property.getName().equals(name)) { try { result = property.getValue() != null && StringUtils.isNotBlank(property.getValue()) && property.getValue().equalsIgnoreCase("true"); } catch (final Exception e) { } } } } return result; }
/** */ public boolean getBooleanProperty(String name, boolean defautVal) { boolean result = defautVal; if (properties != null && properties.getProperties() != null) { for (final VLViewPropertyXML property : properties.getProperties()) { if (property.getName().equals(name)) { try { result = property.getValue() != null && StringUtils.isNotBlank(property.getValue()) && property.getValue().equalsIgnoreCase("true"); } catch (final Exception e) { } } } } return result; }
public int getIntPropertyValue(String name) { int result = Integer.MIN_VALUE; if (properties != null && properties.getProperties() != null) { for (final VLViewPropertyXML property : properties.getProperties()) { if (property.getName().equals(name)) { try { result = Integer.parseInt(property.getValue()); } catch (final Exception e) { } } } } return result; }
/** * @{inheritedDoc} */ @Override public Map<String, String> unmarshal(VLViewPropertiesXML v) throws Exception { Map<String, String> values = new HashMap<>(); if (v != null) { if (v.getProperties() != null && !v.getProperties().isEmpty()) { List<VLViewPropertyXML> d = v.getProperties(); for (VLViewPropertyXML p : d) { values.put(p.getName(), p.getValue()); } } } return values; }