Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Preserve mc:AlternateContent in a pptx slide's p:controls
- Loading branch information
Showing
9 changed files
with
571 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,363 @@ | ||
|
||
package org.docx4j.mce; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import javax.xml.bind.Unmarshaller; | ||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlAnyElement; | ||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlTransient; | ||
import javax.xml.bind.annotation.XmlType; | ||
import org.jvnet.jaxb2_commons.ppp.Child; | ||
import org.w3c.dom.Element; | ||
|
||
|
||
/** | ||
* <p>Java class for anonymous complex type. | ||
* | ||
* <p>The following schema fragment specifies the expected content contained within this class. | ||
* | ||
* <pre> | ||
* <complexType> | ||
* <complexContent> | ||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | ||
* <sequence> | ||
* <element name="Choice" maxOccurs="unbounded"> | ||
* <complexType> | ||
* <complexContent> | ||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | ||
* <sequence> | ||
* <any processContents='skip' maxOccurs="unbounded"/> | ||
* </sequence> | ||
* <attribute name="Requires" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> | ||
* </restriction> | ||
* </complexContent> | ||
* </complexType> | ||
* </element> | ||
* <element name="Fallback" minOccurs="0"> | ||
* <complexType> | ||
* <complexContent> | ||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | ||
* <sequence> | ||
* <any processContents='skip' maxOccurs="unbounded"/> | ||
* </sequence> | ||
* </restriction> | ||
* </complexContent> | ||
* </complexType> | ||
* </element> | ||
* </sequence> | ||
* </restriction> | ||
* </complexContent> | ||
* </complexType> | ||
* </pre> | ||
* | ||
* | ||
*/ | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@XmlType(name = "", propOrder = { | ||
"choice", | ||
"fallback" | ||
}) | ||
@XmlRootElement(name = "AlternateContent") | ||
public class AlternateContent | ||
implements Child | ||
{ | ||
|
||
@XmlElement(name = "Choice", required = true) | ||
protected List<AlternateContent.Choice> choice; | ||
@XmlElement(name = "Fallback") | ||
protected AlternateContent.Fallback fallback; | ||
@XmlTransient | ||
private Object parent; | ||
|
||
/** | ||
* Gets the value of the choice property. | ||
* | ||
* <p> | ||
* This accessor method returns a reference to the live list, | ||
* not a snapshot. Therefore any modification you make to the | ||
* returned list will be present inside the JAXB object. | ||
* This is why there is not a <CODE>set</CODE> method for the choice property. | ||
* | ||
* <p> | ||
* For example, to add a new item, do as follows: | ||
* <pre> | ||
* getChoice().add(newItem); | ||
* </pre> | ||
* | ||
* | ||
* <p> | ||
* Objects of the following type(s) are allowed in the list | ||
* {@link AlternateContent.Choice } | ||
* | ||
* | ||
*/ | ||
public List<AlternateContent.Choice> getChoice() { | ||
if (choice == null) { | ||
choice = new ArrayList<AlternateContent.Choice>(); | ||
} | ||
return this.choice; | ||
} | ||
|
||
/** | ||
* Gets the value of the fallback property. | ||
* | ||
* @return | ||
* possible object is | ||
* {@link AlternateContent.Fallback } | ||
* | ||
*/ | ||
public AlternateContent.Fallback getFallback() { | ||
return fallback; | ||
} | ||
|
||
/** | ||
* Sets the value of the fallback property. | ||
* | ||
* @param value | ||
* allowed object is | ||
* {@link AlternateContent.Fallback } | ||
* | ||
*/ | ||
public void setFallback(AlternateContent.Fallback value) { | ||
this.fallback = value; | ||
} | ||
|
||
/** | ||
* Gets the parent object in the object tree representing the unmarshalled xml document. | ||
* | ||
* @return | ||
* The parent object. | ||
*/ | ||
public Object getParent() { | ||
return this.parent; | ||
} | ||
|
||
public void setParent(Object parent) { | ||
this.parent = parent; | ||
} | ||
|
||
/** | ||
* This method is invoked by the JAXB implementation on each instance when unmarshalling completes. | ||
* | ||
* @param parent | ||
* The parent object in the object tree. | ||
* @param unmarshaller | ||
* The unmarshaller that generated the instance. | ||
*/ | ||
public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { | ||
setParent(parent); | ||
} | ||
|
||
|
||
/** | ||
* <p>Java class for anonymous complex type. | ||
* | ||
* <p>The following schema fragment specifies the expected content contained within this class. | ||
* | ||
* <pre> | ||
* <complexType> | ||
* <complexContent> | ||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | ||
* <sequence> | ||
* <any processContents='skip' maxOccurs="unbounded"/> | ||
* </sequence> | ||
* <attribute name="Requires" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> | ||
* </restriction> | ||
* </complexContent> | ||
* </complexType> | ||
* </pre> | ||
* | ||
* | ||
*/ | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@XmlType(name = "", propOrder = { | ||
"any" | ||
}) | ||
public static class Choice | ||
implements Child | ||
{ | ||
|
||
@XmlAnyElement | ||
protected List<Element> any; | ||
@XmlAttribute(name = "Requires", required = true) | ||
protected String requires; | ||
@XmlTransient | ||
private Object parent; | ||
|
||
/** | ||
* Gets the value of the any property. | ||
* | ||
* <p> | ||
* This accessor method returns a reference to the live list, | ||
* not a snapshot. Therefore any modification you make to the | ||
* returned list will be present inside the JAXB object. | ||
* This is why there is not a <CODE>set</CODE> method for the any property. | ||
* | ||
* <p> | ||
* For example, to add a new item, do as follows: | ||
* <pre> | ||
* getAny().add(newItem); | ||
* </pre> | ||
* | ||
* | ||
* <p> | ||
* Objects of the following type(s) are allowed in the list | ||
* {@link Element } | ||
* | ||
* | ||
*/ | ||
public List<Element> getAny() { | ||
if (any == null) { | ||
any = new ArrayList<Element>(); | ||
} | ||
return this.any; | ||
} | ||
|
||
/** | ||
* Gets the value of the requires property. | ||
* | ||
* @return | ||
* possible object is | ||
* {@link String } | ||
* | ||
*/ | ||
public String getRequires() { | ||
return requires; | ||
} | ||
|
||
/** | ||
* Sets the value of the requires property. | ||
* | ||
* @param value | ||
* allowed object is | ||
* {@link String } | ||
* | ||
*/ | ||
public void setRequires(String value) { | ||
this.requires = value; | ||
} | ||
|
||
/** | ||
* Gets the parent object in the object tree representing the unmarshalled xml document. | ||
* | ||
* @return | ||
* The parent object. | ||
*/ | ||
public Object getParent() { | ||
return this.parent; | ||
} | ||
|
||
public void setParent(Object parent) { | ||
this.parent = parent; | ||
} | ||
|
||
/** | ||
* This method is invoked by the JAXB implementation on each instance when unmarshalling completes. | ||
* | ||
* @param parent | ||
* The parent object in the object tree. | ||
* @param unmarshaller | ||
* The unmarshaller that generated the instance. | ||
*/ | ||
public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { | ||
setParent(parent); | ||
} | ||
|
||
} | ||
|
||
|
||
/** | ||
* <p>Java class for anonymous complex type. | ||
* | ||
* <p>The following schema fragment specifies the expected content contained within this class. | ||
* | ||
* <pre> | ||
* <complexType> | ||
* <complexContent> | ||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | ||
* <sequence> | ||
* <any processContents='skip' maxOccurs="unbounded"/> | ||
* </sequence> | ||
* </restriction> | ||
* </complexContent> | ||
* </complexType> | ||
* </pre> | ||
* | ||
* | ||
*/ | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@XmlType(name = "", propOrder = { | ||
"any" | ||
}) | ||
public static class Fallback | ||
implements Child | ||
{ | ||
|
||
@XmlAnyElement | ||
protected List<Element> any; | ||
@XmlTransient | ||
private Object parent; | ||
|
||
/** | ||
* Gets the value of the any property. | ||
* | ||
* <p> | ||
* This accessor method returns a reference to the live list, | ||
* not a snapshot. Therefore any modification you make to the | ||
* returned list will be present inside the JAXB object. | ||
* This is why there is not a <CODE>set</CODE> method for the any property. | ||
* | ||
* <p> | ||
* For example, to add a new item, do as follows: | ||
* <pre> | ||
* getAny().add(newItem); | ||
* </pre> | ||
* | ||
* | ||
* <p> | ||
* Objects of the following type(s) are allowed in the list | ||
* {@link Element } | ||
* | ||
* | ||
*/ | ||
public List<Element> getAny() { | ||
if (any == null) { | ||
any = new ArrayList<Element>(); | ||
} | ||
return this.any; | ||
} | ||
|
||
/** | ||
* Gets the parent object in the object tree representing the unmarshalled xml document. | ||
* | ||
* @return | ||
* The parent object. | ||
*/ | ||
public Object getParent() { | ||
return this.parent; | ||
} | ||
|
||
public void setParent(Object parent) { | ||
this.parent = parent; | ||
} | ||
|
||
/** | ||
* This method is invoked by the JAXB implementation on each instance when unmarshalling completes. | ||
* | ||
* @param parent | ||
* The parent object in the object tree. | ||
* @param unmarshaller | ||
* The unmarshaller that generated the instance. | ||
*/ | ||
public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { | ||
setParent(parent); | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.