本文整理了Java中org.eclipse.xsd.XSDComplexTypeDefinition.getAttributeContents()
方法的一些代码示例,展示了XSDComplexTypeDefinition.getAttributeContents()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDComplexTypeDefinition.getAttributeContents()
方法的具体详情如下:
包路径:org.eclipse.xsd.XSDComplexTypeDefinition
类名称:XSDComplexTypeDefinition
方法名:getAttributeContents
[英]Returns the value of the 'Attribute Contents' containment reference list. The list contents are of type org.eclipse.xsd.XSDAttributeGroupContent.
This concrete reference represents the attribute contents defined within the body of a complexType element.
[中]返回“属性内容”包含引用列表的值。列表内容的类型为org。日食xsd。XSDATTributeGroup内容。
这个具体的引用表示在{$0$}元素的主体中定义的属性内容。
代码示例来源:origin: geotools/geotools
List attContent = cType.getAttributeContents();
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public static List getChildAttributes(XSDComplexTypeDefinition ct)
{
EList attrContents = ct.getAttributeContents();
List attrs = new ArrayList();
for (int i = 0; i < attrContents.size(); i++)
{
Object next = attrContents.get(i);
if (next instanceof XSDAttributeUse)
{
attrs.add(((XSDAttributeUse) next).getContent().getResolvedAttributeDeclaration());
}
else if (next instanceof XSDAttributeGroupDefinition)
{
//XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) next;
}
}
return attrs;
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected static Map<String, XSDAttributeDeclaration> getProhibitedAttributeURIs(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
Map<String, XSDAttributeDeclaration> result = getProhibitedAttributes(xsdComplexTypeDefinition.getAttributeContents());
if (xsdComplexTypeDefinition.getBaseTypeDefinition() instanceof XSDComplexTypeDefinition &&
!xsdComplexTypeDefinition.isCircular())
{
result.putAll
(getProhibitedAttributes
(((XSDComplexTypeDefinition)xsdComplexTypeDefinition.getBaseTypeDefinition()).getAttributeContents()));
}
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected static Map<String, XSDAttributeDeclaration> getProhibitedAttributeURIs(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
Map<String, XSDAttributeDeclaration> result = getProhibitedAttributes(xsdComplexTypeDefinition.getAttributeContents());
if (xsdComplexTypeDefinition.getBaseTypeDefinition() instanceof XSDComplexTypeDefinition &&
!xsdComplexTypeDefinition.isCircular())
{
result.putAll
(getProhibitedAttributes
(((XSDComplexTypeDefinition)xsdComplexTypeDefinition.getBaseTypeDefinition()).getAttributeContents()));
}
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
private void updateNames(XSDComplexTypeDefinition ct)
{
Iterator iter = ct.getAttributeContents().iterator();
while (iter.hasNext())
{
Object obj = iter.next();
if (obj instanceof XSDAttributeUse)
{
XSDAttributeUse use = (XSDAttributeUse) obj;
XSDAttributeDeclaration attr = use.getAttributeDeclaration();
String attrName = attr.getName();
if (attrName != null)
{
names.add(attrName);
}
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public List getAttributeGroupContent()
{
EList attrContent = getXSDComplexTypeDefinition().getAttributeContents();
List attrUses = new ArrayList();
List list = new ArrayList();
for (Iterator it = attrContent.iterator(); it.hasNext();)
{
XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) it.next();
if (attrGroupContent instanceof XSDAttributeGroupDefinition)
{
XSDAttributeGroupDefinition attributeGroupDefinition = (XSDAttributeGroupDefinition) attrGroupContent;
list.add(XSDAdapterFactory.getInstance().adapt(attributeGroupDefinition));
getAttributeUses(attributeGroupDefinition, attrUses);
}
else
{
attrUses.add(attrGroupContent);
list.add(new TargetConnectionSpaceFiller(this));
}
}
return list;
}
代码示例来源:origin: org.geotools/gt2-xml-core
public boolean visit(XSDTypeDefinition type) {
//simple types dont have attributes
if (type instanceof XSDSimpleTypeDefinition) {
return true;
}
XSDComplexTypeDefinition cType = (XSDComplexTypeDefinition) type;
//get all the attribute content (groups,or uses) and add to q
List attContent = cType.getAttributeContents();
for (Iterator itr = attContent.iterator(); itr.hasNext();) {
XSDAttributeGroupContent content = (XSDAttributeGroupContent) itr.next();
if (content instanceof XSDAttributeUse) {
//an attribute, add it to the list
XSDAttributeUse use = (XSDAttributeUse) content;
attributes.add(use.getAttributeDeclaration());
} else if (content instanceof XSDAttributeGroupDefinition) {
//attribute group, add all atts in group to list
XSDAttributeGroupDefinition attGrp = (XSDAttributeGroupDefinition) content;
if (attGrp.isAttributeGroupDefinitionReference()) {
attGrp = attGrp.getResolvedAttributeGroupDefinition();
}
List uses = attGrp.getAttributeUses();
for (Iterator aitr = uses.iterator(); aitr.hasNext();) {
XSDAttributeUse use = (XSDAttributeUse) aitr.next();
attributes.add(use.getAttributeDeclaration());
}
}
}
return true;
}
};
代码示例来源:origin: org.geotools.xsd/gt-core
public boolean visit(XSDTypeDefinition type) {
//simple types dont have attributes
if (type instanceof XSDSimpleTypeDefinition) {
return true;
}
XSDComplexTypeDefinition cType = (XSDComplexTypeDefinition) type;
//get all the attribute content (groups,or uses) and add to q
List attContent = cType.getAttributeContents();
for (Iterator itr = attContent.iterator(); itr.hasNext();) {
XSDAttributeGroupContent content = (XSDAttributeGroupContent) itr.next();
if (content instanceof XSDAttributeUse) {
//an attribute, add it to the list
XSDAttributeUse use = (XSDAttributeUse) content;
attributes.add(use.getAttributeDeclaration());
} else if (content instanceof XSDAttributeGroupDefinition) {
//attribute group, add all atts in group to list
XSDAttributeGroupDefinition attGrp = (XSDAttributeGroupDefinition) content;
if (attGrp.isAttributeGroupDefinitionReference()) {
attGrp = attGrp.getResolvedAttributeGroupDefinition();
}
List uses = attGrp.getAttributeUses();
for (Iterator aitr = uses.iterator(); aitr.hasNext();) {
XSDAttributeUse use = (XSDAttributeUse) aitr.next();
attributes.add(use.getAttributeDeclaration());
}
}
}
return true;
}
};
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected List<XSDAttributeUse> getAttributeUses(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
if (useSortedAttributes())
{
return xsdComplexTypeDefinition.getAttributeUses();
}
else
{
List<XSDAttributeUse> result = new ArrayList<XSDAttributeUse>(xsdComplexTypeDefinition.getAttributeUses());
reorderAttributeUses(result, xsdComplexTypeDefinition.getAttributeContents());
return result;
}
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected List<XSDAttributeUse> getAttributeUses(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
if (useSortedAttributes())
{
return xsdComplexTypeDefinition.getAttributeUses();
}
else
{
List<XSDAttributeUse> result = new ArrayList<XSDAttributeUse>(xsdComplexTypeDefinition.getAttributeUses());
reorderAttributeUses(result, xsdComplexTypeDefinition.getAttributeContents());
return result;
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
if (type.getAttributeContents() != null)
for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected void makeReferenceAttribute(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
attrDecl.setName(getName(reference));
setReferenceAttribType(attrDecl);
XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
attrUse.setContent(attrDecl);
xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
map(attrUse, reference);
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected void makeReferenceAttribute(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
attrDecl.setName(getName(reference));
setReferenceAttribType(attrDecl);
XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
attrUse.setContent(attrDecl);
xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
map(attrUse, reference);
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected void addXMIAttributes(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
if (!minimizedXMI)
{
importXMI();
XSDAttributeGroupDefinition objAttribs = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
objAttribs.setResolvedAttributeGroupDefinition(objAttribs.resolveAttributeGroupDefinition(XMI_URI, "ObjectAttribs"));
xsdComplexTypeDefinition.getAttributeContents().add(0, objAttribs);
}
else
{
if (!useEncodedAttributeStyle)
{
importXMI();
XSDAttributeGroupDefinition linkAttribs = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
linkAttribs.setResolvedAttributeGroupDefinition(linkAttribs.resolveAttributeGroupDefinition(XMI_URI, "LinkAttribs"));
xsdComplexTypeDefinition.getAttributeContents().add(0, linkAttribs);
}
}
if (!minimizedXMI)
{
importXMI();
XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
attrDecl.setResolvedAttributeDeclaration(attrDecl.resolveAttributeDeclaration(XMI_URI, "id"));
XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
attrUse.setContent(attrDecl);
xsdComplexTypeDefinition.getAttributeContents().add(0, attrUse);
}
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected void addXMIAttributes(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
if (!minimizedXMI)
{
importXMI();
XSDAttributeGroupDefinition objAttribs = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
objAttribs.setResolvedAttributeGroupDefinition(objAttribs.resolveAttributeGroupDefinition(XMI_URI, "ObjectAttribs"));
xsdComplexTypeDefinition.getAttributeContents().add(0, objAttribs);
}
else
{
if (!useEncodedAttributeStyle)
{
importXMI();
XSDAttributeGroupDefinition linkAttribs = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
linkAttribs.setResolvedAttributeGroupDefinition(linkAttribs.resolveAttributeGroupDefinition(XMI_URI, "LinkAttribs"));
xsdComplexTypeDefinition.getAttributeContents().add(0, linkAttribs);
}
}
if (!minimizedXMI)
{
importXMI();
XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
attrDecl.setResolvedAttributeDeclaration(attrDecl.resolveAttributeDeclaration(XMI_URI, "id"));
XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
attrUse.setContent(attrDecl);
xsdComplexTypeDefinition.getAttributeContents().add(0, attrUse);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void visitComplexTypeDefinition(XSDComplexTypeDefinition type)
if (type.getAttributeContents() != null)
for (Iterator iter = type.getAttributeContents().iterator(); iter.hasNext(); )
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected void createAttributeDeclaration(EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
attrDecl.setName(getName(attribute));
setAttributeType(attribute, attrDecl);
setDefaultValue(attribute, attrDecl);
XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
setUseToRequired(attribute, attrUse);
attrUse.setContent(attrDecl);
xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
map(attrUse, attribute);
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected void createAttributeDeclaration(EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
attrDecl.setName(getName(attribute));
setAttributeType(attribute, attrDecl);
setDefaultValue(attribute, attrDecl);
XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
setUseToRequired(attribute, attrUse);
attrUse.setContent(attrDecl);
xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
map(attrUse, attribute);
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
@Override
protected void validateValue()
{
XSDSimpleTypeDefinition whiteSpaceEnumeration =
((XSDAttributeUse)
((XSDComplexTypeDefinition)
getSimpleTypeDefinition().
getSchema().
getSchemaForSchema().
resolveElementDeclaration("whiteSpace").
getTypeDefinition()).
getAttributeContents().get(0)).
getAttributeDeclaration().getTypeDefinition();
checkSimpleTypeConstraint
(whiteSpaceEnumeration,
getLexicalValue(),
XSDConstants.PART2,
"element-whiteSpace",
getElement(),
XSDConstants.VALUE_ATTRIBUTE,
true);
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
@Override
protected void validateValue()
{
XSDSimpleTypeDefinition whiteSpaceEnumeration =
((XSDAttributeUse)
((XSDComplexTypeDefinition)
getSimpleTypeDefinition().
getSchema().
getSchemaForSchema().
resolveElementDeclaration("whiteSpace").
getTypeDefinition()).
getAttributeContents().get(0)).
getAttributeDeclaration().getTypeDefinition();
checkSimpleTypeConstraint
(whiteSpaceEnumeration,
getLexicalValue(),
XSDConstants.PART2,
"element-whiteSpace",
getElement(),
XSDConstants.VALUE_ATTRIBUTE,
true);
}
内容来源于网络,如有侵权,请联系作者删除!