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

org.apache.ws.commons.schema.walker.XmlSchemaAttrInfo Maven / Gradle / Ivy

There is a newer version: 2.3.1
Show newest version
/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.ws.commons.schema.walker;

import org.apache.ws.commons.schema.XmlSchemaAttribute;

/**
 * This represents a complete XML Schema Attribute, after references are
 * followed and types are defined.
 */
public class XmlSchemaAttrInfo {

    /**
     * Constructs a new XmlSchemaAttrInfo from the provided
     * {@link XmlSchemaAttribute} and {@link XmlSchemaTypeInfo}.
     * 

* The XmlSchemaAttribute represents the XML attribute * definition after any references have been resolved, and merged with the * global definition. *

* * @param attribute The underlying XmlSchemaAttribute. * @param attrType The attribute's type. */ public XmlSchemaAttrInfo(XmlSchemaAttribute attribute, XmlSchemaTypeInfo attrType) { this(attribute); this.attrType = attrType; } XmlSchemaAttrInfo(XmlSchemaAttribute attribute, boolean isTopLevel) { this.attribute = attribute; this.isTopLevel = isTopLevel; this.attrType = null; } XmlSchemaAttrInfo(XmlSchemaAttribute attribute) { this(attribute, attribute.isTopLevel()); } /** * The underlying {@link XmlSchemaAttribute}. If the attribute was * originally a reference, this instance is merged with the global attribute * it referenced. *

* The only exception is with {@link XmlSchemaAttribute#isTopLevel()}. A * copy of the XmlSchemaAttribute may have been made in order * to properly merge a local reference with a global definition. When that * happens, XmlSchemaAttribute.isTopLevel() may not return the * correct result. Use {@link #isTopLevel()} instead. *

*/ public XmlSchemaAttribute getAttribute() { return attribute; } /** * The attribute's value type. */ public XmlSchemaTypeInfo getType() { return attrType; } /** * Whether the attribute exists in the global namespace. Because a copy of * {@link XmlSchemaAttribute} may have been made in order to merge a local * reference with the global definition, * {@link XmlSchemaAttribute#isTopLevel()} may no longer be accurate. */ public boolean isTopLevel() { return isTopLevel; } void setType(XmlSchemaTypeInfo attrType) { this.attrType = attrType; } private final XmlSchemaAttribute attribute; private final boolean isTopLevel; private XmlSchemaTypeInfo attrType; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy