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

x33g5p2x  于2022-02-03 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(80)

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

XSDAttributeDeclaration.getAnonymousTypeDefinition介绍

[英]Returns the value of the 'Anonymous Type Definition' containment reference.

This concrete reference represents a simple type definition defined within the body of an attribute element.
[中]返回“匿名类型定义”包含引用的值。
这个具体的引用表示在{$0$}元素体中定义的简单类型定义。

代码示例

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

if ( attribute.getAnonymousTypeDefinition() != null ) {
  attribute.getAnonymousTypeDefinition().setName( "_" + attribute.getName() );
  anonymous.add( attribute.getAnonymousTypeDefinition() );

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

public static XSDSimpleTypeDefinition getAnonymousSimpleType(XSDFeature input, XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
{
 XSDSimpleTypeDefinition anonymousSimpleType = null;
 XSDTypeDefinition localType = null;
 if (input instanceof XSDElementDeclaration)
 {
  localType = ((XSDElementDeclaration) input).getAnonymousTypeDefinition();
 }
 else if (input instanceof XSDAttributeDeclaration)
 {
  localType = ((XSDAttributeDeclaration) input).getAnonymousTypeDefinition();
 }
 if (localType instanceof XSDSimpleTypeDefinition)
 {
  anonymousSimpleType = (XSDSimpleTypeDefinition) localType;
 }
 return anonymousSimpleType;
}

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

public String getTextForAttribute(XSDAttributeDeclaration ad, boolean showType)
{
 ad = ad.getResolvedAttributeDeclaration();
 String name = ad.getName();
 StringBuffer result = new StringBuffer();
 if (name == null)
 {
  result.append(" " + Messages._UI_LABEL_ABSENT + " ");  //$NON-NLS-1$ //$NON-NLS-2$
 }
 else
 {
  result.append(name);
 }
 if (ad.getAnonymousTypeDefinition() == null && ad.getTypeDefinition() != null)
 {
  result.append(" : "); //$NON-NLS-1$
  // result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
  result.append(ad.getTypeDefinition().getName());
 }
 return result.toString();
}

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

@Override
public String getText(Object object)
{
 XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object);
 XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration();
 String name =
  xsdAttributeDeclaration != resolvedAttributeDeclaration ?
   xsdAttributeDeclaration.getQName() :
   xsdAttributeDeclaration.getName();
 StringBuffer result = new StringBuffer();
 if (name == null)
 {
  result.append(XSDEditPlugin.INSTANCE.getString("_UI_Absent_label"));
 }
 else
 {
  result.append(name);
 }
 if (resolvedAttributeDeclaration.getAnonymousTypeDefinition() == null && resolvedAttributeDeclaration.getTypeDefinition() != null)
 {
  result.append(" : ");
  result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration));
 }
 return result.toString();
}

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

protected boolean canEnable(XSDConcreteComponent selectedObject) {
  selectedComponent = null;
  if (selectedObject instanceof XSDNamedComponent) {
    selectedComponent = (XSDNamedComponent) selectedObject;
    // if it's element reference, then this action is not appropriate
    if (selectedComponent instanceof XSDElementDeclaration) {
      XSDElementDeclaration element = (XSDElementDeclaration) selectedComponent;
      if (element.isElementDeclarationReference()) {
        selectedComponent = null;
      }
    }
    if(selectedComponent instanceof XSDTypeDefinition){
      XSDTypeDefinition type = (XSDTypeDefinition) selectedComponent;
      XSDConcreteComponent parent = type.getContainer();
      if (parent instanceof XSDElementDeclaration) {
        XSDElementDeclaration element = (XSDElementDeclaration) parent;
        if(element.getAnonymousTypeDefinition().equals(type)){
          selectedComponent = null;
        }
      }
      else if(parent instanceof XSDAttributeDeclaration) {
        XSDAttributeDeclaration element = (XSDAttributeDeclaration) parent;
        if(element.getAnonymousTypeDefinition().equals(type)){
          selectedComponent = null;
        }
      }
    }
  }
  return canRun();
}

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

public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration attributeDeclaration)
{
 XSDConcreteComponent target = null;
 if (attributeDeclaration.isAttributeDeclarationReference())
 {
  target = attributeDeclaration.getResolvedAttributeDeclaration();
 }
 else if (attributeDeclaration.getAnonymousTypeDefinition() == null)
 {
  target = attributeDeclaration.getTypeDefinition();
  // Avoid navigating to built in data types.
  if (isFromSchemaForSchema(target))
  {
   target = null;
  }
 }
 return target;
}

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

else if (attrDecl.getAnonymousTypeDefinition() == null)

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

isAttributeReference = ((XSDAttributeDeclaration)input).isAttributeDeclarationReference();
XSDTypeDefinition typeDef = xsdAttribute.getTypeDefinition();
boolean isAnonymous = xsdAttribute.getAnonymousTypeDefinition() != null;

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

anonymousTypeDefinition = xsdAttributeDeclaration.getResolvedAttributeDeclaration().getAnonymousTypeDefinition();

相关文章

微信公众号

最新文章

更多