All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.persistence.jaxb.compiler.NamespaceInfo Maven / Gradle / Ivy

There is a newer version: 5.0.0-B02
Show newest version
/*******************************************************************************
 * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
 * This program and the accompanying materials are made available under the 
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
 * which accompanies this distribution. 
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at 
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * Contributors:
 *     Oracle - initial API and implementation from Oracle TopLink
 ******************************************************************************/  
package org.eclipse.persistence.jaxb.compiler;

import org.eclipse.persistence.oxm.NamespaceResolver;

/**
 *  INTERNAL:
 *  

Purpose:To store some information about a schema's target namespace and some additional * information gathered from XmlSchema annotation at the package (namespace) level *

Responsibilities:

    *
  • Store target namespace and namespace prefix information for a specific schema
  • *
  • Store some additional Schema information (such as element/attribute form and XmlAccessType)
  • *
* * @see org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor * @author mmacivor * @since Oracle TopLink 11.1.1.0.0 */ public class NamespaceInfo { private String namespace; private boolean attributeFormQualified = false; private boolean elementFormQualified = false; private NamespaceResolver namespaceResolver; private String location; private NamespaceResolver namespaceResolverForDescriptor; public String getNamespace() { return namespace; } public void setNamespace(String ns) { if(ns != null) { ns = ns.intern(); } this.namespace = ns; } public boolean isAttributeFormQualified() { return attributeFormQualified; } public void setAttributeFormQualified(boolean b) { attributeFormQualified = b; } public boolean isElementFormQualified() { return elementFormQualified; } public void setElementFormQualified(boolean b) { elementFormQualified = b; } public NamespaceResolver getNamespaceResolver() { return namespaceResolver; } public void setNamespaceResolver(NamespaceResolver resolver) { namespaceResolver = resolver; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public NamespaceResolver getNamespaceResolverForDescriptor() { if(this.namespaceResolverForDescriptor == null) { this.namespaceResolverForDescriptor = new NamespaceResolver(); if(this.namespaceResolver.hasPrefixesToNamespaces()) { for(String next:this.namespaceResolver.getPrefixesToNamespaces().keySet()) { this.namespaceResolverForDescriptor.put(next, this.namespaceResolver.resolveNamespacePrefix(next)); } } this.namespaceResolverForDescriptor.setDefaultNamespaceURI(namespaceResolver.getDefaultNamespaceURI()); } return this.namespaceResolverForDescriptor; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy