org.opendope.conditions.Condition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docx4j Show documentation
Show all versions of docx4j Show documentation
docx4j is a library which helps you to work with the Office Open
XML file format as used in docx
documents, pptx presentations, and xlsx spreadsheets.
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.09.27 at 06:57:43 PM EST
//
package org.opendope.conditions;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.docx4j.XmlUtils;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.openpackaging.parts.CustomXmlDataStoragePart;
import org.docx4j.openpackaging.parts.opendope.ConditionsPart;
/**
* Java class for anonymous complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <element ref="{http://opendope.org/conditions}xpathref"/>
* <element ref="{http://opendope.org/conditions}and"/>
* <element ref="{http://opendope.org/conditions}or"/>
* <element ref="{http://opendope.org/conditions}not"/>
* </choice>
* <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="descrption" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="comments" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"particle"
})
@XmlRootElement(name = "condition")
public class Condition implements Evaluable {
@XmlElements({
@XmlElement(name = "xpathref", type = Xpathref.class),
@XmlElement(name = "and", type = And.class),
@XmlElement(name = "or", type = Or.class),
@XmlElement(name = "not", type = Not.class)
})
protected Evaluable particle;
@XmlAttribute(name = "id", required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
@XmlAttribute(name = "name")
protected String name;
@XmlAttribute(name = "descrption")
protected String descrption;
@XmlAttribute(name = "comments")
protected String comments;
/**
* Gets the value of the particle property.
*
* @return
* possible object is
* {@link Xpathref }
* {@link And }
* {@link Or }
* {@link Not }
*
*/
public Evaluable getParticle() {
return particle;
}
/**
* Sets the value of the particle property.
*
* @param value
* allowed object is
* {@link Xpathref }
* {@link And }
* {@link Or }
* {@link Not }
*
*/
public void setParticle(Evaluable value) {
this.particle = value;
}
public boolean evaluate(WordprocessingMLPackage pkg,
Map customXmlDataStorageParts,
Conditions conditions,
org.opendope.xpaths.Xpaths xPaths) {
return particle.evaluate(pkg, customXmlDataStorageParts, conditions, xPaths);
}
public void listXPaths( List theList,
Conditions conditions,
org.opendope.xpaths.Xpaths xPaths) {
particle.listXPaths(theList, conditions, xPaths);
}
public String toString(Conditions conditions,
org.opendope.xpaths.Xpaths xPaths) {
return particle.toString(conditions, xPaths);
}
public Condition repeat(String xpathBase,
int index,
Conditions conditions,
org.opendope.xpaths.Xpaths xPaths) {
// Create and add new condition
Condition newCondition = XmlUtils.deepCopy(this);
String newConditionId = id + "_" + index;
newCondition.setId(newConditionId);
conditions.getCondition().add(newCondition);
// Fix its particles
newCondition.getParticle().repeat(xpathBase, index, conditions, xPaths);
return newCondition;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the descrption property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescrption() {
return descrption;
}
/**
* Sets the value of the descrption property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescrption(String value) {
this.descrption = value;
}
/**
* Gets the value of the comments property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getComments() {
return comments;
}
/**
* Sets the value of the comments property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setComments(String value) {
this.comments = value;
}
}