if ( type.getName() == null ) {
+ name(attribute) + " of " + getName()); if (type.getName() == null) {
public boolean isFocusAllowed() { XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target; if (XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001.equals(xsdSimpleTypeDefinition.getTargetNamespace())) { return false; } if (xsdSimpleTypeDefinition.getName() == null) { return false; } return true; }
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(); }
/** * Returns whether the type definition is a built-in type with the given name * or is derived from a built-in type with that name. * @param xsdSimpleTypeDefinition a type definition. * @return whether the type definition is a built-in type with the given name * or is derived from a built-in type with that name. * @since 2.4 */ public static boolean isOrIsDerivedFrom(XSDSimpleTypeDefinition xsdSimpleTypeDefinition, String name) { Set<XSDTypeDefinition> visited = new HashSet<XSDTypeDefinition>(); while (xsdSimpleTypeDefinition != null) { if (isSchemaForSchemaNamespace(xsdSimpleTypeDefinition.getTargetNamespace()) && name.equals(xsdSimpleTypeDefinition.getName())) { return true; } if (!visited.add(xsdSimpleTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition())) { return false; } } return false; }
public static boolean isLocalReferenceType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) { while (xsdSimpleTypeDefinition != null) { if (XSDConstants.isAnySimpleType(xsdSimpleTypeDefinition)) { return false; } String name = xsdSimpleTypeDefinition.getName(); if (XSDConstants.isSchemaForSchemaNamespace(xsdSimpleTypeDefinition.getTargetNamespace()) && ("IDREF".equals(name) || "IDREFS".equals(name))) { return true; } xsdSimpleTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition(); } return false; }
public static boolean isLocalReferenceType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) { while (xsdSimpleTypeDefinition != null) { if (XSDConstants.isAnySimpleType(xsdSimpleTypeDefinition)) { return false; } String name = xsdSimpleTypeDefinition.getName(); if (XSDConstants.isSchemaForSchemaNamespace(xsdSimpleTypeDefinition.getTargetNamespace()) && ("IDREF".equals(name) || "IDREFS".equals(name))) { return true; } xsdSimpleTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition(); } return false; }
String basePrimitiveTypeString = basePrimitiveType != null ? basePrimitiveType.getName() : ""; currentPrimitiveType = basePrimitiveType; titleString = Messages._UI_LABEL_TYPE + (anonymousTypeDefinition != null ? "(" + xsdFeature.getResolvedFeature().getName() + "Type)" : xsdSimpleTypeDefinition.getName()) + " , " + Messages._UI_LABEL_BASE + ": " + basePrimitiveTypeString; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ titleString = Messages._UI_LABEL_TYPE + (anonymousTypeDefinition != null ? "(" + xsdFeature.getResolvedFeature().getName() + "Type)" : xsdSimpleTypeDefinition.getName()); titleString = Messages._UI_LABEL_TYPE + (xsdSimpleTypeDefinition.getName() == null ? "(localType)" : xsdSimpleTypeDefinition.getName()) + " , " + Messages._UI_LABEL_BASE + ": " + xsdSimpleTypeDefinition.getBaseTypeDefinition().getName(); //$NON-NLS-1$ //$NON-NLS-2$
simpleTypeModifierGroupTitle = Messages._UI_LABEL_CONSTRAINTS_ON_LENGTH_OF + targetST.getName(); isNumericBaseType = false; hasMaxMinFacets = true; simpleTypeModifierGroupTitle = Messages._UI_LABEL_CONSTRAINTS_ON_VALUE_OF + targetST.getName(); minLengthString = Messages._UI_LABEL_MINIMUM_VALUE; maxLengthString = Messages._UI_LABEL_MAXIMUM_VALUE; simpleTypeModifierGroupTitle = Messages._UI_LABEL_CONTRAINTS_ON + (targetST != null ? targetST.getName() : "anyType"); //$NON-NLS-1$
/** * Returns whether the simple type definition is the * <a href="http://www.w3.org/TR/xmlschema-2/#dt-ID">ID</a>. * @param xsdSimpleTypeDefinition a simple type definition. * @return whether the simple type definition is */ public static boolean isOrIsDerivedFromID(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) { while (xsdSimpleTypeDefinition != null) { if (isURType(xsdSimpleTypeDefinition)) { return false; } if (isSchemaForSchemaNamespace(xsdSimpleTypeDefinition.getTargetNamespace()) && "ID".equals(xsdSimpleTypeDefinition.getName())) { return true; } xsdSimpleTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition(); } return false; } }
@Override public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) { XSDSimpleTypeDefinition redefinedSimpleTypeDefinition = resolveSimpleTypeDefinition(xsdSimpleTypeDefinition.getName()); for (XSDSchemaImpl schemaToRedefine : getSchemasToRedefine()) { int index = schemaToRedefine.getTypeDefinitions().indexOf(redefinedSimpleTypeDefinition); if (index != -1) { schemaToRedefine.getTypeDefinitions().set(index, xsdSimpleTypeDefinition); schemaToRedefine.redefinitionMap.put(xsdSimpleTypeDefinition, redefinedSimpleTypeDefinition); } } return this; } @Override
@Override public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) { XSDSimpleTypeDefinition redefinedSimpleTypeDefinition = resolveSimpleTypeDefinition(xsdSimpleTypeDefinition.getName()); for (XSDSchemaImpl schemaToRedefine : getSchemasToRedefine()) { int index = schemaToRedefine.getTypeDefinitions().indexOf(redefinedSimpleTypeDefinition); if (index != -1) { schemaToRedefine.getTypeDefinitions().set(index, xsdSimpleTypeDefinition); schemaToRedefine.redefinitionMap.put(xsdSimpleTypeDefinition, redefinedSimpleTypeDefinition); } } return this; } @Override
public int compareValues(Object value1, Object value2) { if (XSDOrdered.FALSE_LITERAL != getOrderedFacet().getValue()) { XSDSimpleTypeDefinition thePrimitiveTypeDefinition = getPrimitiveTypeDefinition(); if (thePrimitiveTypeDefinition != null) { XSDAnySimpleType xsdAnySimpleType = XSDTypeRegister.getTypeImplementer(thePrimitiveTypeDefinition.getName()); return value1 == null ? value2 == null ? 0 : -1 : value2 == null ? 1 : xsdAnySimpleType.compareValues(value1, value2); } } return 0; }
public int compareValues(Object value1, Object value2) { if (XSDOrdered.FALSE_LITERAL != getOrderedFacet().getValue()) { XSDSimpleTypeDefinition thePrimitiveTypeDefinition = getPrimitiveTypeDefinition(); if (thePrimitiveTypeDefinition != null) { XSDAnySimpleType xsdAnySimpleType = XSDTypeRegister.getTypeImplementer(thePrimitiveTypeDefinition.getName()); return value1 == null ? value2 == null ? 0 : -1 : value2 == null ? 1 : xsdAnySimpleType.compareValues(value1, value2); } } return 0; }
@Override protected void patch() { super.patch(); XSDAttributeDeclaration theResolvedAttributeDeclaration = getResolvedAttributeDeclaration(); if (theResolvedAttributeDeclaration == this) { XSDSimpleTypeDefinition typeDefinition = getTypeDefinition(); if (typeDefinition != null && (forceResolve && typeDefinition.getName() != null || typeDefinition.getContainer() == null)) { XSDSimpleTypeDefinition newTypeDefinition = resolveSimpleTypeDefinition(typeDefinition.getTargetNamespace(), typeDefinition.getName()); if (forceResolve || newTypeDefinition.getContainer() != null & newTypeDefinition != typeDefinition) { setTypeDefinitionGen(newTypeDefinition); } } } else { XSDAttributeDeclaration newResolvedAttributeDeclaration = resolveAttributeDeclaration(theResolvedAttributeDeclaration.getTargetNamespace(), theResolvedAttributeDeclaration.getName()); if (newResolvedAttributeDeclaration != theResolvedAttributeDeclaration) { setResolvedAttributeDeclaration(newResolvedAttributeDeclaration); } } }
if (primitiveTypeDefinition != null) result.setAnnotationURI(XSDConstants.PART2 + "#" + primitiveTypeDefinition.getName());
@Override protected void patch() { super.patch(); XSDAttributeDeclaration theResolvedAttributeDeclaration = getResolvedAttributeDeclaration(); if (theResolvedAttributeDeclaration == this) { XSDSimpleTypeDefinition typeDefinition = getTypeDefinition(); if (typeDefinition != null && (forceResolve && typeDefinition.getName() != null || typeDefinition.getContainer() == null)) { XSDSimpleTypeDefinition newTypeDefinition = resolveSimpleTypeDefinition(typeDefinition.getTargetNamespace(), typeDefinition.getName()); if (forceResolve || newTypeDefinition.getContainer() != null & newTypeDefinition != typeDefinition) { setTypeDefinitionGen(newTypeDefinition); } } } else { XSDAttributeDeclaration newResolvedAttributeDeclaration = resolveAttributeDeclaration(theResolvedAttributeDeclaration.getTargetNamespace(), theResolvedAttributeDeclaration.getName()); if (newResolvedAttributeDeclaration != theResolvedAttributeDeclaration) { setResolvedAttributeDeclaration(newResolvedAttributeDeclaration); } } }
if (primitiveTypeDefinition != null) result.setAnnotationURI(XSDConstants.PART2 + "#" + primitiveTypeDefinition.getName());
clonedAttributeDeclaration.setTypeDefinition (createUnresolvedSimpleTypeDefinition (theTypeDefinition.getTargetNamespace(), theTypeDefinition.getName()));