gpt4 book ai didi

org.eclipse.xsd.XSDConcreteComponent.getContainer()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 17:45:05 26 4
gpt4 key购买 nike

本文整理了Java中org.eclipse.xsd.XSDConcreteComponent.getContainer()方法的一些代码示例,展示了XSDConcreteComponent.getContainer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDConcreteComponent.getContainer()方法的具体详情如下:
包路径:org.eclipse.xsd.XSDConcreteComponent
类名称:XSDConcreteComponent
方法名:getContainer

XSDConcreteComponent.getContainer介绍

[英]Returns the value of the 'Container' reference.

This represents the concrete container of this component, i.e., the inverse of the black diamond relations in the UML model.
[中]返回“Container”引用的值。
这表示该组件的具体容器,即UML模型中黑钻石关系的倒数。

代码示例

代码示例来源:origin: geotools/geotools

public void visit(XSDParticle particle) {
    XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent();
    if (decl.isElementDeclarationReference()) {
      decl = decl.getResolvedElementDeclaration();
    }
    if (decl == fElement) {
      if (particle.isSetMaxOccurs()) {
        maxOccurs.add(Integer.valueOf(particle.getMaxOccurs()));
      } else if (particle.getContainer() instanceof XSDModelGroup
          && particle.getContainer().getContainer()
              instanceof XSDParticle) {
        particle = (XSDParticle) particle.getContainer().getContainer();
        maxOccurs.add(Integer.valueOf(particle.getMaxOccurs()));
      } else {
        maxOccurs.add(1);
      }
    }
  }
};

代码示例来源:origin: geotools/geotools

public void visit(XSDParticle particle) {
    XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent();
    if (decl.isElementDeclarationReference()) {
      decl = decl.getResolvedElementDeclaration();
    }
    if (decl == fElement) {
      if (particle.isSetMinOccurs()) {
        minOccurs.add(Integer.valueOf(particle.getMinOccurs()));
      } else if (particle.getContainer() instanceof XSDModelGroup
          && particle.getContainer().getContainer()
              instanceof XSDParticle) {
        particle = (XSDParticle) particle.getContainer().getContainer();
        minOccurs.add(Integer.valueOf(particle.getMinOccurs()));
      } else {
        minOccurs.add(1);
      }
    }
  }
};

代码示例来源:origin: org.eclipse/org.eclipse.xsd

public XSDConcreteComponent getRootContainer()
{
 for (XSDConcreteComponent root = this;;)
 {
  XSDConcreteComponent parent = root.getContainer();
  if (parent == null)
  {
   return root;
  }
  root = parent;
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

public XSDSchema getSchema()
{
 for (XSDConcreteComponent container = this; container != null; container = container.getContainer())
 {
  if (container instanceof XSDSchema)
  {
   return (XSDSchema)container;
  }
 }
 return null;
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

public XSDConcreteComponent getRootContainer()
{
 for (XSDConcreteComponent root = this;;)
 {
  XSDConcreteComponent parent = root.getContainer();
  if (parent == null)
  {
   return root;
  }
  root = parent;
 }
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

public boolean contains(XSDConcreteComponent xsdConcreteComponent)
{
 while (xsdConcreteComponent != null)
 {
  if (xsdConcreteComponent == this)
  {
   return true;
  }
  xsdConcreteComponent = xsdConcreteComponent.getContainer();
 }
 return false;
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

public XSDSchema getSchema()
{
 for (XSDConcreteComponent container = this; container != null; container = container.getContainer())
 {
  if (container instanceof XSDSchema)
  {
   return (XSDSchema)container;
  }
 }
 return null;
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

public boolean contains(XSDConcreteComponent xsdConcreteComponent)
{
 while (xsdConcreteComponent != null)
 {
  if (xsdConcreteComponent == this)
  {
   return true;
  }
  xsdConcreteComponent = xsdConcreteComponent.getContainer();
 }
 return false;
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

private boolean isComponentDefined(XSDConcreteComponent component)
{
 // note the getContainer() test to eliminate 'synthetic' types
 // that are created by the XMLSchema model when resolution fails   
 return component != null && component.getContainer() != null;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public MakeLocalElementGlobalCommand
 (XSDConcreteComponent element)
{
 super(element.getContainer());
 setModelObject(element);
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public MakeAnonymousTypeGlobalCommand(XSDConcreteComponent element,
    String newName) {
  super(element.getContainer());
  setModelObject(element);
  fNewName = newName;
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

public XSDScope getScope()
{
 for (XSDConcreteComponent container = getContainer(); container != null; container = container.getContainer())
 {
  if (container instanceof XSDScope)
  {
   return (XSDScope)container;
  }
  else if (container instanceof XSDModelGroupDefinition || container instanceof XSDAttributeGroupDefinition)
  {
   return null;
  }
 }
 return null;
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

public boolean isGlobal()
{
 for (XSDConcreteComponent container = getContainer(); container != null; container = container.getContainer())
 {
  if (container instanceof XSDScope)
  {
   return container instanceof XSDSchema;
  }
  else if (container instanceof XSDModelGroupDefinition || container instanceof XSDAttributeGroupDefinition)
  {
   return false;
  }
 }
 return true;
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

public XSDScope getScope()
{
 for (XSDConcreteComponent container = getContainer(); container != null; container = container.getContainer())
 {
  if (container instanceof XSDScope)
  {
   return (XSDScope)container;
  }
  else if (container instanceof XSDModelGroupDefinition || container instanceof XSDAttributeGroupDefinition)
  {
   return null;
  }
 }
 return null;
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

public boolean isGlobal()
{
 for (XSDConcreteComponent container = getContainer(); container != null; container = container.getContainer())
 {
  if (container instanceof XSDScope)
  {
   return container instanceof XSDSchema;
  }
  else if (container instanceof XSDModelGroupDefinition || container instanceof XSDAttributeGroupDefinition)
  {
   return false;
  }
 }
 return true;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

if (nextRefComponent.getContainer().getContainer() == parentComponent)
if (previousRefComponent.getContainer().getContainer() == parentComponent)

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public static int getMinOccurs(XSDConcreteComponent component)
{
 int minOccur = -2;
 if (component != null)
 {
  Object o = component.getContainer();
  if (o instanceof XSDParticle)
  {
   if (((XSDParticle) o).isSetMinOccurs())
   {
    try
    {
     minOccur = ((XSDParticle) o).getMinOccurs();
    }
    catch (Exception e)
    {
    }
   }
  }
 }
 return minOccur;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public static int getMaxOccurs(XSDConcreteComponent component)
{
 int maxOccur = -2;
 if (component != null)
 {
  Object o = component.getContainer();
  if (o instanceof XSDParticle)
  {
   if (((XSDParticle) o).isSetMaxOccurs())
   {
    try
    {
     maxOccur = ((XSDParticle) o).getMaxOccurs();
    }
    catch (Exception e)
    {
    }
   }
  }
 }
 return maxOccur;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void mouseDoubleClick(MouseEvent e)
 {
  ISelection iSelection = getTreeViewer().getSelection();
  if (iSelection instanceof StructuredSelection)
  {
   StructuredSelection selection = (StructuredSelection) iSelection;
   Object obj = selection.getFirstElement();
   if (obj instanceof XSDConcreteComponent)
   {
    XSDConcreteComponent comp = (XSDConcreteComponent) obj;
    if (comp.getContainer() instanceof XSDSchema)
    {
     // getXSDEditor().getGraphViewer().setInput(obj);
    }
   }
  }
 }
});

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

/**
 * Wraps an XSD diagnostic into a WSDL diagnostic. Used to report problems in
 * inline schemas.
 * 
 * @param xsdDiagnostic
 *          the XSD diagnostic object to wrap. Must not be null.
 */
public WSDLDiagnosticImpl(XSDDiagnostic xsdDiagnostic)
{
 this();
 setMessage(xsdDiagnostic.getMessage());
 setSeverity(getSeverity(xsdDiagnostic.getSeverity()));
 setLine(xsdDiagnostic.getLine());
 setColumn(xsdDiagnostic.getColumn());
 setNode(xsdDiagnostic.getNode());
 setContainer(xsdDiagnostic.getContainer());
 setLocation(xsdDiagnostic.getLocation());
 setKey(xsdDiagnostic.getKey());
 getSubstitutions().addAll(xsdDiagnostic.getSubstitutions());
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com