public VLViewPropertiesXML build() { return new VLViewPropertiesXML(this); } }
/** * @param name * @return */ public VLViewPropertyXML getPropertyByName(String name) { return properties.getPropertyByName(name); }
/** * @param name * @return */ public String getPropertyValueByName(String name) { return properties.getPropertyValueByName(name); }
/** * @{inheritedDoc} */ @Override public VLViewPropertiesXML marshal(Map<String, String> v) throws Exception { VLViewPropertiesXML propertiesXML = new VLViewPropertiesXML(); for(String p: v.keySet()) { VLViewPropertyXML q = new VLViewPropertyXML(); q.setName(p); q.setValue(v.get(p)); propertiesXML.getProperties().add(q); } return propertiesXML; } }
/** * @{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; }
public void addProperty(String name, String value) { VLViewPropertyXML prop = new VLViewPropertyXML(); prop.setName(name); prop.setValue(value); addProperty(prop); }
/** * @param data * @return */ public static VLViewRootMenuRowXML buildRow(OperationData data) { VLViewRootMenuRowXML row = new VLViewRootMenuRowXML(); VLViewPropertiesXML propertiesXML = new VLViewPropertiesXML(); row.setProperties(propertiesXML); VLViewPropertyXML translatedLabel = new VLViewPropertyXML(); translatedLabel.setName("translatedLabel"); translatedLabel.setValue((String) data.getAttributes().get("translatedLabel")); propertiesXML.getProperties().add(translatedLabel); VLViewPropertyXML icon = new VLViewPropertyXML(); icon.setName("icon"); icon.setValue((String) data.getAttributes().get("icon")); propertiesXML.getProperties().add(icon); return row; } }
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; }
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 String getPropertyValue(String name) { if (properties == null) { return null; } return properties.getPropertyValueByName(name); }
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; }
/** * @return */ public boolean addSeparatorAfter() { String addString = properties.getPropertyValueByName("separator-after"); return StringUtils.isNotBlank(addString) && Boolean.valueOf(addString); }
/** */ 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; }