本文整理了Java中org.eclipse.xsd.XSDNamedComponent
类的一些代码示例,展示了XSDNamedComponent
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDNamedComponent
类的具体详情如下:
包路径:org.eclipse.xsd.XSDNamedComponent
类名称:XSDNamedComponent
[英]A representation of the model object 'Named Component'. It is used to represent aspects common to org.eclipse.xsd.XSDAttributeDeclaration, org.eclipse.xsd.XSDAttributeGroupDefinition, org.eclipse.xsd.XSDComplexTypeDefinition, org.eclipse.xsd.XSDElementDeclaration, org.eclipse.xsd.XSDIdentityConstraintDefinition, org.eclipse.xsd.XSDModelGroupDefinition, org.eclipse.xsd.XSDNotationDeclaration, and org.eclipse.xsd.XSDSimpleTypeDefinition.
The following features are supported:
代码示例来源:origin: geotools/geotools
public GetPropertyExecutor(Object parent, XSDNamedComponent content) {
this.parent = parent;
name = new QName(content.getTargetNamespace(), content.getName());
}
代码示例来源:origin: geotools/geotools
String ns1 = component.getTargetNamespace();
String ns2 = qName.getNamespaceURI();
String n1 = component.getName();
String n2 = qName.getLocalPart();
if (component.getSchema() != null) {
ns1 = component.getSchema().getTargetNamespace();
代码示例来源:origin: geotools/geotools
XSDNamedComponent named = (XSDNamedComponent)arguments[0];
XSDSchema schema = named.getSchema();
XSDTypeDefinition type = null;
stringBuffer.append(named.getTargetNamespace());
stringBuffer.append(TEXT_2);
stringBuffer.append(named.getName());
stringBuffer.append(TEXT_3);
xmls.getTransformer().transform(new DOMSource(named.getElement()), new StreamResult(writer));
String className = named.getName().substring(0,1).toUpperCase() +
named.getName().substring(1) + "BindingTest";
String baseClassName = prefix.toUpperCase() + "TestSupport";
stringBuffer.append(prefix.toUpperCase());
stringBuffer.append(TEXT_9);
stringBuffer.append(named.getName());
stringBuffer.append(TEXT_10);
stringBuffer.append(prefix.toUpperCase());
stringBuffer.append(TEXT_11);
stringBuffer.append(named.getName());
stringBuffer.append(TEXT_12);
return stringBuffer.toString();
代码示例来源:origin: geotools/geotools
protected boolean included(XSDNamedComponent c) {
return included != null ? included.contains( c.getName() ) : true;
}
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
public void validateNoDuplicates(String componentNoun, EList<? extends XSDNamedComponent> xsdNamedComponents)
{
String name = null;
String targetNamespace = null;
for (XSDNamedComponent xsdNamedComponent : xsdNamedComponents)
{
if (xsdNamedComponent.hasNameAndTargetNamespace(name, targetNamespace))
{
getDiagnosticTarget(xsdNamedComponent).createDiagnostic
(XSDDiagnosticSeverity.ERROR_LITERAL,
"coss-schema.2",
XSDPlugin.INSTANCE.getString(componentNoun),
xsdNamedComponent.getURI());
}
name = xsdNamedComponent.getName();
targetNamespace = xsdNamedComponent.getTargetNamespace();
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
/**
* Performs a rename refactoring to rename the component and all the
* references to it within the current schema.
*
* @param newName the new component name.
*/
private void renameComponent(String newName)
{
// this is a 'globally' defined component (e.g. global element)
if (component.eContainer() instanceof XSDSchema)
{
RefactoringComponent refactoringComponent = new XMLRefactoringComponent(
component,
(IDOMElement)component.getElement(),
component.getName(),
component.getTargetNamespace());
RenameComponentProcessor processor = new RenameComponentProcessor(refactoringComponent, newName, true);
RenameRefactoring refactoring = new RenameRefactoring(processor);
PerformUnsavedRefactoringOperation operation = new PerformUnsavedRefactoringOperation(refactoring);
operation.run(null);
}
else
{
// this is a 'locally' defined component (e.g. local element)
// no need to call refactoring since this component can't be referenced
component.setName(newName);
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
public EPackage getEPackage(XSDNamedComponent xsdNamedComponent)
XSDSchema containingXSDSchema = xsdNamedComponent.getSchema();
if (containingXSDSchema != null && !xsdSchemas.contains(containingXSDSchema))
xsdNamedComponent.getTargetNamespace() :
containingXSDSchema.getTargetNamespace();
EPackage ePackage = targetNamespaceToEPackageMap.get(targetNamespace);
代码示例来源:origin: geotools/geotools
boolean target(XSDNamedComponent c, XSDSchema schema) {
return c.getTargetNamespace().equals(schema.getTargetNamespace());
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
Element element = namedComponent.getElement();
if (element != null)
String name = namedComponent.getName();
if (name != null)
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public UpdateNameCommand(String label, XSDNamedComponent component, String newName)
{
super(label);
if (component instanceof XSDComplexTypeDefinition && component.getName() == null && component.eContainer() instanceof XSDNamedComponent && ((XSDNamedComponent) component.eContainer()).getName() != null)
{
component = (XSDNamedComponent) component.eContainer();
}
this.component = component;
this.newName = newName;
// this.oldName = component.getName();
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void doWidgetSelected(SelectionEvent e)
{
if (e.widget == componentNameCombo)
{
String newValue = componentNameCombo.getText();
if (input instanceof XSDNamedComponent)
{
XSDNamedComponent namedComponent = (XSDNamedComponent)input;
Element element = namedComponent.getElement();
if (namedComponent instanceof XSDModelGroupDefinition)
{
element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
}
}
}
super.doWidgetSelected(e);
}
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
protected void changeReference(EReference eReference)
{
if (isReconciling)
return;
super.changeReference(eReference);
Element theElement = getElement();
if (theElement != null)
{
if (eReference == null || eReference == WSDLPackage.Literals.PART__TYPE_DEFINITION)
{
XSDTypeDefinition typeDefinition = getTypeDefinition();
if (typeDefinition != null)
{
niceSetAttributeURIValue(theElement, WSDLConstants.TYPE_ATTRIBUTE, typeDefinition.getURI());
}
}
if (eReference == null || eReference == WSDLPackage.Literals.PART__ELEMENT_DECLARATION)
{
XSDElementDeclaration elementDecl = getElementDeclaration();
if (elementDecl != null)
{
niceSetAttributeURIValue(theElement, WSDLConstants.ELEMENT_ATTRIBUTE, elementDecl.getURI());
}
}
}
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
String baseName = xsdNamedComponent.getAliasName();
if (container instanceof XSDSimpleTypeDefinition)
代码示例来源:origin: geotools/geotools
String testName(XSDNamedComponent c) {
return c.getName().substring(0, 1).toUpperCase()
+ c.getName().substring(1) + "BindingTest";
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
public void validateNoDuplicates(String componentNoun, EList<? extends XSDNamedComponent> xsdNamedComponents)
{
String name = null;
String targetNamespace = null;
for (XSDNamedComponent xsdNamedComponent : xsdNamedComponents)
{
if (xsdNamedComponent.hasNameAndTargetNamespace(name, targetNamespace))
{
getDiagnosticTarget(xsdNamedComponent).createDiagnostic
(XSDDiagnosticSeverity.ERROR_LITERAL,
"coss-schema.2",
XSDPlugin.INSTANCE.getString(componentNoun),
xsdNamedComponent.getURI());
}
name = xsdNamedComponent.getName();
targetNamespace = xsdNamedComponent.getTargetNamespace();
}
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
public EPackage getEPackage(XSDNamedComponent xsdNamedComponent)
XSDSchema containingXSDSchema = xsdNamedComponent.getSchema();
if (containingXSDSchema != null && !xsdSchemas.contains(containingXSDSchema))
xsdNamedComponent.getTargetNamespace() :
containingXSDSchema.getTargetNamespace();
EPackage ePackage = targetNamespaceToEPackageMap.get(targetNamespace);
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected boolean isFromThisNamespace(XSDNamedComponent xsdNamedComponent)
{
String targetNamespace = xsdNamedComponent.getTargetNamespace();
return targetNamespace == null ? xsdSchema.getTargetNamespace() == null : targetNamespace.equals(xsdSchema.getTargetNamespace());
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
Element element = namedComponent.getElement();
if (element != null)
String name = namedComponent.getName();
if (name != null)
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void doWidgetSelected(SelectionEvent e)
{
if (e.widget == refCombo)
{
String newValue = refCombo.getText();
if (input instanceof XSDNamedComponent)
{
XSDNamedComponent namedComponent = (XSDNamedComponent)input;
Element element = namedComponent.getElement();
if (namedComponent instanceof XSDAttributeGroupDefinition)
{
element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue);
}
}
}
super.doWidgetSelected(e);
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
String baseName = xsdNamedComponent.getAliasName();
if (container instanceof XSDSimpleTypeDefinition)
内容来源于网络,如有侵权,请联系作者删除!