public class PropertiesFragment extends FragmentBase implements PSMLFragment
Warning: this version only supports single value properties.
Constructor and Description |
---|
PropertiesFragment(String id)
Creates a new properties fragment with the specified ID.
|
PropertiesFragment(String id,
String type)
Creates a new properties fragment with the specified ID and type.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Property p)
Adds a property to the fragment.
|
List<Property> |
getProperties() |
Property |
getProperty(String name)
Returns the property for the specified name.
|
String |
getPropertyValue(String name)
Returns the property for the specified name.
|
void |
set(Property property)
Sets a property.
|
void |
setProperty(String name,
int value)
Sets a property.
|
void |
setProperty(String name,
String value)
Sets a property.
|
void |
toXML(org.pageseeder.xmlwriter.XMLWriter psml) |
id, toPSML, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
id, toPSML, type
public PropertiesFragment(String id)
id
- The fragment ID.public Property getProperty(String name)
name
- the property name.null
.NullPointerException
- if the name if null
public List<Property> getProperties()
public void add(Property p)
p
- The property to add.public void set(Property property)
Note: If multiple properties share the same name ALL of them are changed.
property
- The property to set.public String getPropertyValue(String name)
name
- the property name.null
.NullPointerException
- if the name if null
public void setProperty(String name, String value)
Note: If multiple properties share the same name ALL of them are changed.
If the property does not exist in the fragment nothing happens.
name
- The name of the property to set.value
- The value of the property to set.public void setProperty(String name, int value)
Note: If multiple properties share the same name ALL of them are changed.
If the property does not exist in the fragment nothing happens.
name
- The name of the property to set.value
- The value of the property to set.public void toXML(org.pageseeder.xmlwriter.XMLWriter psml) throws IOException
toXML
in interface org.pageseeder.xmlwriter.XMLWritable
IOException
Copyright © 2016 Allette Systems. All rights reserved.