}
private void processInitialValue(Element element) {
// Create a container to hold the initial value.
SingleValueContainer container = new SingleValueContainer();
pushObject(container);
// Create a container for a property reference.
PropertyReference reference = new PropertyReference();
pushObject(reference);
// Create a container for a computed reference.
ComputedReference computedRef = new ComputedReference();
pushObject(computedRef);
// Process the children.
processThemePropertyChildren(element);
popObject();
popObject();
popObject();
String computedPropertyRef = computedRef.getPropertyName();
String propertyReference = reference.getPropertyName();
Value initialValue = container.getValue();
if ((propertyReference != null && initialValue != null) ||
(propertyReference != null && computedPropertyRef != null) ||
(computedPropertyRef != null && initialValue != null)) {
throw new IllegalStateException(
"Only a property reference, computed reference" +
" or an initial value are allowed, not both");
}
Property property = (Property) findObject(Property.class);
ValueSource source;
if (initialValue != null) {
source = new FixedValueSource(container.getValue());
property.setInitialValue(container.getValue());
} else if (propertyReference != null) {
source = new PropertyValueSource(propertyReference);
} else if (computedPropertyRef != null) {
source = new ComputedValueSource(
computedPropertyRef, computedRef.getRules());