Package org.apache.cxf.javascript
Class ParticleInfo
- java.lang.Object
-
- org.apache.cxf.javascript.ParticleInfo
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ParticleInfoforGlobalElement(org.apache.ws.commons.schema.XmlSchemaElement element, org.apache.ws.commons.schema.XmlSchema currentSchema, SchemaCollection schemaCollection, NamespacePrefixAccumulator prefixAccumulator)Create an elementInfo that stores information about a global, named, element.static ParticleInfoforLocalItem(org.apache.ws.commons.schema.XmlSchemaObject sequenceObject, org.apache.ws.commons.schema.XmlSchema currentSchema, SchemaCollection schemaCollection, NamespacePrefixAccumulator prefixAccumulator, QName contextName)Fill in an ElementInfo for an element or xs:any from a sequence.static ParticleInfoforPartElement(org.apache.ws.commons.schema.XmlSchemaElement element, SchemaCollection schemaCollection, String javascriptName, String xmlElementName)Create element information for a part element.List<ParticleInfo>getChildren()org.apache.ws.commons.schema.XmlSchemaTypegetContainingType()QNamegetControllingName()As a general rule, the JavaScript code is organized by types.StringgetDefaultValue()*StringgetJavascriptName()longgetMaxOccurs()longgetMinOccurs()org.apache.ws.commons.schema.XmlSchemaParticlegetParticle()org.apache.ws.commons.schema.XmlSchemaTypegetType()StringgetXmlName()booleanisAny()booleanisAnyType()booleanisArray()booleanisEmpty()booleanisGlobal()True if this describes a global, named, element.booleanisGroup()booleanisNillable()booleanisOptional()voidsetContainingType(org.apache.ws.commons.schema.XmlSchemaType containingType)voidsetDefaultValue(String defaultValue)voidsetEmpty(boolean empty)voidsetJavascriptName(String name)voidsetType(org.apache.ws.commons.schema.XmlSchemaType type)voidsetXmlName(String elementXmlName)StringtoString()
-
-
-
Method Detail
-
forGlobalElement
public static ParticleInfo forGlobalElement(org.apache.ws.commons.schema.XmlSchemaElement element, org.apache.ws.commons.schema.XmlSchema currentSchema, SchemaCollection schemaCollection, NamespacePrefixAccumulator prefixAccumulator)
Create an elementInfo that stores information about a global, named, element.- Parameters:
element- the elementcurrentSchema- the schema it came from.schemaCollection- the collection of all schemas.prefixAccumulator- the accumulator that assigns prefixes.- Returns:
-
forPartElement
public static ParticleInfo forPartElement(org.apache.ws.commons.schema.XmlSchemaElement element, SchemaCollection schemaCollection, String javascriptName, String xmlElementName)
Create element information for a part element. For a part, the JavaScript and Element names are calculated in advance, and the element itself might be null! In that case, the minOccurs and maxOccurs are conventional. Note that in some cases the code in ServiceJavascriptBuilder uses a local element (or xa:any) from inside the part element, instead of the part element itself.- Parameters:
element- the element, or nullschemaCollection- the schema collection, for resolving types.javascriptName- javascript variable namexmlElementName- xml element string- Returns:
-
forLocalItem
public static ParticleInfo forLocalItem(org.apache.ws.commons.schema.XmlSchemaObject sequenceObject, org.apache.ws.commons.schema.XmlSchema currentSchema, SchemaCollection schemaCollection, NamespacePrefixAccumulator prefixAccumulator, QName contextName)
Fill in an ElementInfo for an element or xs:any from a sequence.- Parameters:
sequenceObject-currentSchema-schemaCollection-prefixAccumulator-contextName-- Returns:
-
getControllingName
public QName getControllingName()
As a general rule, the JavaScript code is organized by types. The exception is global elements that have anonymous types. In those cases, the JavaScript code has its functions named according to the element. This method returns the QName for the type or element, accordingly. If a schema has a local element with an anonymous, complex, type, this will throw. This will need to be fixed.- Returns:
- the qname.
-
getParticle
public org.apache.ws.commons.schema.XmlSchemaParticle getParticle()
-
getJavascriptName
public String getJavascriptName()
- Specified by:
getJavascriptNamein interfaceItemInfo
-
setJavascriptName
public void setJavascriptName(String name)
-
getXmlName
public String getXmlName()
-
setXmlName
public void setXmlName(String elementXmlName)
-
getContainingType
public org.apache.ws.commons.schema.XmlSchemaType getContainingType()
-
setContainingType
public void setContainingType(org.apache.ws.commons.schema.XmlSchemaType containingType)
-
getType
public org.apache.ws.commons.schema.XmlSchemaType getType()
-
setType
public void setType(org.apache.ws.commons.schema.XmlSchemaType type)
-
isGroup
public boolean isGroup()
-
getChildren
public List<ParticleInfo> getChildren()
-
isEmpty
public boolean isEmpty()
-
setEmpty
public void setEmpty(boolean empty)
-
getMinOccurs
public long getMinOccurs()
-
getMaxOccurs
public long getMaxOccurs()
-
isOptional
public boolean isOptional()
- Specified by:
isOptionalin interfaceItemInfo
-
isNillable
public boolean isNillable()
- Specified by:
isNillablein interfaceItemInfo- Returns:
- Returns the nillable flag for the element. False for 'xs:any'
-
isAnyType
public boolean isAnyType()
-
getDefaultValue
public String getDefaultValue()
*- Specified by:
getDefaultValuein interfaceItemInfo- Returns:
- Returns the defaultValue.
-
setDefaultValue
public void setDefaultValue(String defaultValue)
- Specified by:
setDefaultValuein interfaceItemInfo- Parameters:
defaultValue- The defaultValue to set.
-
isGlobal
public boolean isGlobal()
True if this describes a global, named, element.- Returns:
-
-