本文整理了Java中org.eclipse.xsd.XSDAttributeDeclaration.getTargetNamespace()
方法的一些代码示例,展示了XSDAttributeDeclaration.getTargetNamespace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDAttributeDeclaration.getTargetNamespace()
方法的具体详情如下:
包路径:org.eclipse.xsd.XSDAttributeDeclaration
类名称:XSDAttributeDeclaration
方法名:getTargetNamespace
暂无
代码示例来源:origin: geotools/geotools
public AttributeEncodeExecutor(
Object object, XSDAttributeDeclaration attribute, Document document, Logger logger) {
this.object = object;
this.attribute = attribute;
this.document = document;
this.logger = logger;
encoding = document.createAttributeNS(attribute.getTargetNamespace(), attribute.getName());
}
代码示例来源:origin: geotools/geotools
protected void buildAttriubuteIndex() {
attributeIndex = new HashMap();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
for (Iterator a = schema.getAttributeDeclarations().iterator(); a.hasNext(); ) {
XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) a.next();
QName qName = new QName(attribute.getTargetNamespace(), attribute.getName());
attributeIndex.put(qName, attribute);
}
}
}
代码示例来源:origin: geotools/geotools
@Override
public boolean isIdentifiable(XSDComplexTypeDefinition typeDefinition) {
List attributeUses = typeDefinition.getAttributeUses();
final String idAttName = getId().getLocalPart();
for (Iterator it = attributeUses.iterator(); it.hasNext(); ) {
XSDAttributeUse use = (XSDAttributeUse) it.next();
XSDAttributeUseCategory useCategory = use.getUse();
XSDAttributeDeclaration idAtt = use.getAttributeDeclaration();
String targetNamespace = idAtt.getTargetNamespace();
String name = idAtt.getName();
if (getNameSpace().equals(targetNamespace) && idAttName.equals(name)) {
if (XSDAttributeUseCategory.REQUIRED_LITERAL.equals(useCategory)) {
return true;
}
}
}
return false;
}
代码示例来源:origin: geotools/geotools
XSDAttributeDeclaration attribute = (XSDAttributeDeclaration)itr.next();
if (attribute.getName() == null) continue;
if (!ns.equals(attribute.getTargetNamespace())) continue;
代码示例来源:origin: geotools/geotools
String ns = attribute.getTargetNamespace();
String local = attribute.getName();
代码示例来源:origin: geotools/geotools
if (Utilities.equals(ad.getTargetNamespace(), attribute.getTargetNamespace())
&& Utilities.equals(ad.getName(), attribute.getName())) {
type = ad.getTypeDefinition();
代码示例来源:origin: geotools/geotools
att.setNamespace(decl.getTargetNamespace());
att.setName(decl.getName());
att.setText(attributes.getValue(i));
代码示例来源:origin: geotools/geotools
if (Utilities.equals(ad.getTargetNamespace(),
attribute.getTargetNamespace())
&& Utilities.equals(ad.getName(), attribute.getName())) {
type = ad.getTypeDefinition();
代码示例来源:origin: org.geotools.xsd/gt-core
public AttributeEncodeExecutor(Object object, XSDAttributeDeclaration attribute,
Document document, Logger logger) {
this.object = object;
this.attribute = attribute;
this.document = document;
this.logger = logger;
encoding = document.createAttributeNS(attribute.getTargetNamespace(), attribute.getName());
}
代码示例来源:origin: org.geotools/gt2-xml-core
public AttributeEncodeExecutor(Object object, XSDAttributeDeclaration attribute,
Document document, Logger logger) {
this.object = object;
this.attribute = attribute;
this.document = document;
this.logger = logger;
encoding = document.createAttributeNS(attribute.getTargetNamespace(), attribute.getName());
}
代码示例来源:origin: org.geotools/gt2-xml-xsd
public AttributeEncodeExecutor(
Object object, XSDAttributeDeclaration attribute, Document document, Logger logger
) {
this.object = object;
this.attribute = attribute;
this.document = document;
this.logger = logger;
encoding = document
.createAttributeNS(attribute.getTargetNamespace(), attribute.getName());
}
代码示例来源:origin: org.geotools/gt2-xml-core
protected void buildAttriubuteIndex() {
attributeIndex = new HashMap();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
for (Iterator a = schema.getAttributeDeclarations().iterator(); a.hasNext();) {
XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) a.next();
QName qName = new QName(attribute.getTargetNamespace(), attribute.getName());
attributeIndex.put(qName, attribute);
}
}
}
代码示例来源:origin: org.geotools.xsd/gt-core
protected void buildAttriubuteIndex() {
attributeIndex = new HashMap();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
for (Iterator a = schema.getAttributeDeclarations().iterator(); a.hasNext();) {
XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) a.next();
QName qName = new QName(attribute.getTargetNamespace(), attribute.getName());
attributeIndex.put(qName, attribute);
}
}
}
代码示例来源:origin: org.geotools/gt2-xml-xsd
protected void buildAttriubuteIndex() {
attributeIndex = new HashMap();
for (int i = 0; i < schemas.length; i++) {
XSDSchema schema = schemas[i];
for (Iterator a = schema.getAttributeDeclarations().iterator();
a.hasNext();) {
XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) a
.next();
QName qName = new QName(attribute.getTargetNamespace(),
attribute.getName());
attributeIndex.put(qName, attribute);
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public java.util.List getGlobalAttributes()
{
Vector items = new Vector();
if (xsdSchema != null)
{
updateExternalImportGlobals();
if (xsdSchema.getAttributeDeclarations() != null)
{
Iterator i = xsdSchema.getAttributeDeclarations().iterator();
while (i.hasNext())
{
XSDAttributeDeclaration attributeDeclaration = (XSDAttributeDeclaration) i.next();
if (attributeDeclaration.getTargetNamespace() == null || (attributeDeclaration.getTargetNamespace() != null && !attributeDeclaration.getTargetNamespace().equals(XSDConstants.SCHEMA_INSTANCE_URI_2001)))
{
String name = attributeDeclaration.getQName(xsdSchema);
if (name != null)
{
items.add(name);
}
}
}
}
// items = addExternalImportedAttributes(items);
items = (Vector) sortList(items);
}
return items;
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
/** Create a namespace prefix if needed, other wise retrieve
* a predefined namespace prefix
* @return */
private String handleNamespacePrefices()
{
Element schemaElement = component.getSchema().getElement();
String prefix = null;
// If target namespace of the attribute already exists
List namespacePrefices = manager.getNamespaceInfoList(schemaElement);
for (int i = 0; i < namespacePrefices.size(); i++){
NamespaceInfo info = (NamespaceInfo) namespacePrefices.get(i);
if ( info.uri.equals(attribute.getTargetNamespace())) {
prefix = info.prefix;
}
}
// Create unquie namespace prefix
if ( prefix == null){
prefix = createUniquePrefix(component);
}
NamespaceInfo info = new NamespaceInfo(attribute.getTargetNamespace(), prefix, ""); //$NON-NLS-1$
List infoList = new ArrayList(1);
infoList.add(info);
manager.addNamespaceInfo(schemaElement, infoList, false);
return prefix;
}
代码示例来源:origin: org.geotools/gt-app-schema
/**
* Determines if elements of the given complex type definition are required to have an
* identifier by looking for a child element of <code>typeDefinition</code> of the form
* <code><xs:attribute ref="gml:id" use="required" /></code>
*
* @param typeDefinition
* @return
*/
private boolean isIdentifiable(XSDComplexTypeDefinition typeDefinition) {
List attributeUses = typeDefinition.getAttributeUses();
final String idAttName = GML.getId().getLocalPart();
for (Iterator it = attributeUses.iterator(); it.hasNext();) {
XSDAttributeUse use = (XSDAttributeUse) it.next();
XSDAttributeUseCategory useCategory = use.getUse();
XSDAttributeDeclaration idAtt = use.getAttributeDeclaration();
String targetNamespace = idAtt.getTargetNamespace();
String name = idAtt.getName();
if (GML.getNameSpace().equals(targetNamespace) && idAttName.equals(name)) {
if (XSDAttributeUseCategory.REQUIRED_LITERAL.equals(useCategory)) {
return true;
}
}
}
return false;
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.xsd.edit
@Override
public void setPropertyValue(Object o, Object value)
{
XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)o;
if (xsdAttributeDeclaration.isAttributeDeclarationReference())
{
XSDAttributeDeclaration newResolvedAttributeDeclaration =
xsdAttributeDeclaration.resolveAttributeDeclaration(xsdAttributeDeclaration.getTargetNamespace(), (String)value);
EditingDomain editingDomain = getEditingDomain(xsdAttributeDeclaration);
if (editingDomain == null)
{
xsdAttributeDeclaration.setResolvedAttributeDeclaration(newResolvedAttributeDeclaration);
}
else
{
editingDomain.getCommandStack().execute
(SetCommand.create
(editingDomain,
xsdAttributeDeclaration,
xsdPackage.getXSDAttributeDeclaration_ResolvedAttributeDeclaration(),
newResolvedAttributeDeclaration));
}
}
else
{
super.setPropertyValue(o, value);
}
}
});
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
@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);
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
@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);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!