/**
* Copyright 2013 European Parliament
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and limitations under the Licence.
*/
package org.nsesa.editor.gwt.an.common.client.ui.overlay.document.gen.csd05;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import org.nsesa.editor.gwt.an.common.client.ui.overlay.document.gen.xmlschema.AnyURISimpleType;
import org.nsesa.editor.gwt.an.common.client.ui.overlay.document.gen.xmlschema.IDSimpleType;
import org.nsesa.editor.gwt.an.common.client.ui.overlay.document.gen.xmlschema.NMTOKENSimpleType;
import org.nsesa.editor.gwt.core.client.ui.overlay.document.OverlayWidget;
import org.nsesa.editor.gwt.core.client.ui.overlay.document.OverlayWidgetImpl;
import org.nsesa.editor.gwt.core.client.ui.overlay.document.StructureIndicator;
import java.util.ArrayList;
import java.util.LinkedHashMap;
/**
* The complex type parliamentaryAnalysisType lists all the properties associated to elements in the parliamentary analysis.
* This file is generated. Rather than changing this file, correct the template called <tt>overlayClass.ftl</tt>.
*/
public class ParliamentaryAnalysisTypeComplexType extends OverlayWidgetImpl {
/**
* Stores a structure indicator coming from xsd structure *
*/
private static StructureIndicator STRUCTURE_INDICATOR = new StructureIndicator.DefaultStructureIndicator(1, 1
,
new StructureIndicator.DefaultChoice(1, -1, new StructureIndicator.DefaultElement(1, 1, new Quorum())
, new StructureIndicator.DefaultElement(1, 1, new Count())
)
);
/**
* Create a browser DOM span element and set up "type", "ns" and css class attributes
*/
public static Element create() {
com.google.gwt.user.client.Element span = DOM.createSpan();
span.setAttribute("data-type", "parliamentaryAnalysisTypeComplexType");
span.setAttribute("data-ns", "http://docs.oasis-open.org/legaldocml/ns/akn/3.0/CSD05");
span.setClassName("widget parliamentaryAnalysisTypeComplexType");
return span;
}
// CONSTRUCTORS ------------------
/**
* Create a <code>ParliamentaryAnalysisTypeComplexType</code> object with the given DOM element
*/
public ParliamentaryAnalysisTypeComplexType(Element element) {
super(element);
}
// FIELDS ------------------
private AnyURISimpleType outcomeAttr;
private AnyURISimpleType refersToAttr;
private AnyURISimpleType hrefAttr;
private IDSimpleType idAttr;
private NMTOKENSimpleType evolvingIdAttr;
private String wildcardContentAttr;
/**
* Return <code>outcomeAttr</code> property
*
* @return outcomeAttr
*/
public AnyURISimpleType getOutcomeAttr() {
if (outcomeAttr == null) {
outcomeAttr = new AnyURISimpleType();
outcomeAttr.setValue(getElement().getAttribute("outcome"));
}
return outcomeAttr;
}
/**
* Return <code>outcomeAttr</code> property in DSL way
*
* @return outcomeAttr
*/
public AnyURISimpleType outcomeAttr() {
return getOutcomeAttr();
}
/**
* Set <code>outcomeAttr</code> property
*
* @param outcomeAttr the new value
*/
public void setOutcomeAttr(final AnyURISimpleType outcomeAttr) {
this.outcomeAttr = outcomeAttr;
getElement().setAttribute("outcome", outcomeAttr.getValue());
}
/**
* Set <code>outcomeAttr</code> property in DSL way
*
* @param outcomeAttr the new value
* @return <code>ParliamentaryAnalysisTypeComplexType</code> instance
*/
public ParliamentaryAnalysisTypeComplexType outcomeAttr(final AnyURISimpleType outcomeAttr) {
setOutcomeAttr(outcomeAttr);
return this;
}
/**
* Return <code>refersToAttr</code> property
*
* @return refersToAttr
*/
public AnyURISimpleType getRefersToAttr() {
if (refersToAttr == null) {
refersToAttr = new AnyURISimpleType();
refersToAttr.setValue(getElement().getAttribute("refersTo"));
}
return refersToAttr;
}
/**
* Return <code>refersToAttr</code> property in DSL way
*
* @return refersToAttr
*/
public AnyURISimpleType refersToAttr() {
return getRefersToAttr();
}
/**
* Set <code>refersToAttr</code> property
*
* @param refersToAttr the new value
*/
public void setRefersToAttr(final AnyURISimpleType refersToAttr) {
this.refersToAttr = refersToAttr;
getElement().setAttribute("refersTo", refersToAttr.getValue());
}
/**
* Set <code>refersToAttr</code> property in DSL way
*
* @param refersToAttr the new value
* @return <code>ParliamentaryAnalysisTypeComplexType</code> instance
*/
public ParliamentaryAnalysisTypeComplexType refersToAttr(final AnyURISimpleType refersToAttr) {
setRefersToAttr(refersToAttr);
return this;
}
/**
* Return <code>hrefAttr</code> property
*
* @return hrefAttr
*/
public AnyURISimpleType getHrefAttr() {
if (hrefAttr == null) {
hrefAttr = new AnyURISimpleType();
hrefAttr.setValue(getElement().getAttribute("href"));
}
return hrefAttr;
}
/**
* Return <code>hrefAttr</code> property in DSL way
*
* @return hrefAttr
*/
public AnyURISimpleType hrefAttr() {
return getHrefAttr();
}
/**
* Set <code>hrefAttr</code> property
*
* @param hrefAttr the new value
*/
public void setHrefAttr(final AnyURISimpleType hrefAttr) {
this.hrefAttr = hrefAttr;
getElement().setAttribute("href", hrefAttr.getValue());
}
/**
* Set <code>hrefAttr</code> property in DSL way
*
* @param hrefAttr the new value
* @return <code>ParliamentaryAnalysisTypeComplexType</code> instance
*/
public ParliamentaryAnalysisTypeComplexType hrefAttr(final AnyURISimpleType hrefAttr) {
setHrefAttr(hrefAttr);
return this;
}
/**
* Return <code>idAttr</code> property
*
* @return idAttr
*/
public IDSimpleType getIdAttr() {
if (idAttr == null) {
idAttr = new IDSimpleType();
idAttr.setValue(getElement().getAttribute("id"));
}
return idAttr;
}
/**
* Return <code>idAttr</code> property in DSL way
*
* @return idAttr
*/
public IDSimpleType idAttr() {
return getIdAttr();
}
/**
* Set <code>idAttr</code> property
*
* @param idAttr the new value
*/
public void setIdAttr(final IDSimpleType idAttr) {
this.idAttr = idAttr;
getElement().setAttribute("id", idAttr.getValue());
}
/**
* Set <code>idAttr</code> property in DSL way
*
* @param idAttr the new value
* @return <code>ParliamentaryAnalysisTypeComplexType</code> instance
*/
public ParliamentaryAnalysisTypeComplexType idAttr(final IDSimpleType idAttr) {
setIdAttr(idAttr);
return this;
}
/**
* Return <code>evolvingIdAttr</code> property
*
* @return evolvingIdAttr
*/
public NMTOKENSimpleType getEvolvingIdAttr() {
if (evolvingIdAttr == null) {
evolvingIdAttr = new NMTOKENSimpleType();
evolvingIdAttr.setValue(getElement().getAttribute("evolvingId"));
}
return evolvingIdAttr;
}
/**
* Return <code>evolvingIdAttr</code> property in DSL way
*
* @return evolvingIdAttr
*/
public NMTOKENSimpleType evolvingIdAttr() {
return getEvolvingIdAttr();
}
/**
* Set <code>evolvingIdAttr</code> property
*
* @param evolvingIdAttr the new value
*/
public void setEvolvingIdAttr(final NMTOKENSimpleType evolvingIdAttr) {
this.evolvingIdAttr = evolvingIdAttr;
getElement().setAttribute("evolvingId", evolvingIdAttr.getValue());
}
/**
* Set <code>evolvingIdAttr</code> property in DSL way
*
* @param evolvingIdAttr the new value
* @return <code>ParliamentaryAnalysisTypeComplexType</code> instance
*/
public ParliamentaryAnalysisTypeComplexType evolvingIdAttr(final NMTOKENSimpleType evolvingIdAttr) {
setEvolvingIdAttr(evolvingIdAttr);
return this;
}
/**
* Return <code>wildcardContentAttr</code> property
*
* @return wildcardContentAttr
*/
public String getWildcardContentAttr() {
if (wildcardContentAttr == null) {
//hmm nothing to do here
}
return wildcardContentAttr;
}
/**
* Return <code>wildcardContentAttr</code> property in DSL way
*
* @return wildcardContentAttr
*/
public String wildcardContentAttr() {
return getWildcardContentAttr();
}
/**
* Set <code>wildcardContentAttr</code> property
*
* @param wildcardContentAttr the new value
*/
public void setWildcardContentAttr(final String wildcardContentAttr) {
this.wildcardContentAttr = wildcardContentAttr;
getElement().setAttribute("wildcardContent", wildcardContentAttr);
}
/**
* Set <code>wildcardContentAttr</code> property in DSL way
*
* @param wildcardContentAttr the new value
* @return <code>ParliamentaryAnalysisTypeComplexType</code> instance
*/
public ParliamentaryAnalysisTypeComplexType wildcardContentAttr(final String wildcardContentAttr) {
setWildcardContentAttr(wildcardContentAttr);
return this;
}
/**
* Return <code>java.util.List<Quorum></code> property
*
* @return The property as unmodifiable list
*/
public java.util.List<Quorum> getQuorums() {
java.util.List<Quorum> result = new ArrayList<Quorum>();
for (OverlayWidget widget : getChildOverlayWidgets()) {
if ("Quorum".equalsIgnoreCase(widget.getType()) && "http://docs.oasis-open.org/legaldocml/ns/akn/3.0/CSD05".equalsIgnoreCase(widget.getNamespaceURI())) {
result.add((Quorum) widget);
}
}
return java.util.Collections.unmodifiableList(result);
}
/**
* Return <code>java.util.List<Quorum></code> property in DSL way
*
* @return The property as unmodifiable list
*/
public java.util.List<Quorum> getQuorumList() {
return getQuorums();
}
/**
* Add <code>java.util.List<Quorum></code> property in the list of properties
*
* @return The property as unmodifiable list
*/
public Quorum addQuorum(Quorum quorumElem) {
this.addOverlayWidget(quorumElem);
return quorumElem;
}
/**
* Return <code>java.util.List<Count></code> property
*
* @return The property as unmodifiable list
*/
public java.util.List<Count> getCounts() {
java.util.List<Count> result = new ArrayList<Count>();
for (OverlayWidget widget : getChildOverlayWidgets()) {
if ("Count".equalsIgnoreCase(widget.getType()) && "http://docs.oasis-open.org/legaldocml/ns/akn/3.0/CSD05".equalsIgnoreCase(widget.getNamespaceURI())) {
result.add((Count) widget);
}
}
return java.util.Collections.unmodifiableList(result);
}
/**
* Return <code>java.util.List<Count></code> property in DSL way
*
* @return The property as unmodifiable list
*/
public java.util.List<Count> getCountList() {
return getCounts();
}
/**
* Add <code>java.util.List<Count></code> property in the list of properties
*
* @return The property as unmodifiable list
*/
public Count addCount(Count countElem) {
this.addOverlayWidget(countElem);
return countElem;
}
//Override all attributes methods to be conformant with DSL approach
/**
* Returns the namespace URI of this amendable widget.
*
* @return The namesapce as String
*/
@Override
public String getNamespaceURI() {
return "http://docs.oasis-open.org/legaldocml/ns/akn/3.0/CSD05";
}
@Override
public LinkedHashMap<String, String> getAttributes() {
final LinkedHashMap<String, String> attrs = new LinkedHashMap<String, String>();
attrs.putAll(super.getAttributes());
attrs.put("outcome", getOutcomeAttr() != null ? getOutcomeAttr().getValue() : null);
attrs.put("refersTo", getRefersToAttr() != null ? getRefersToAttr().getValue() : null);
attrs.put("href", getHrefAttr() != null ? getHrefAttr().getValue() : null);
attrs.put("id", getIdAttr() != null ? getIdAttr().getValue() : null);
attrs.put("evolvingId", getEvolvingIdAttr() != null ? getEvolvingIdAttr().getValue() : null);
attrs.put("wildcardContent", getWildcardContentAttr() != null ? getWildcardContentAttr().toString() : null);
return attrs;
}
@Override
public StructureIndicator getStructureIndicator() {
return STRUCTURE_INDICATOR;
}
/**
* DSL Style for html method
*/
@Override
public ParliamentaryAnalysisTypeComplexType html(String s) {
super.html(s);
return this;
}
}