|  |  | 
|  |  | 
|  |  */ | 
|  | /* | 
|  |  * 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 com.sun.org.apache.xerces.internal.dom; | 
|  |  | 
|  | import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo; | 
|  | import com.sun.org.apache.xerces.internal.impl.xs.AttributePSVImpl; | 
|  | import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl; | 
|  | import com.sun.org.apache.xerces.internal.xs.*; | 
|  | import com.sun.org.apache.xerces.internal.xs.AttributePSVI; | 
|  | import java.io.IOException; | 
|  | import java.io.NotSerializableException; | 
|  | import java.io.ObjectInputStream; | 
|  | import java.io.ObjectOutputStream; | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  */ | 
|  | public class PSVIAttrNSImpl extends AttrNSImpl implements AttributePSVI { | 
|  |  | 
|  |      | 
|  |     static final long serialVersionUID = -3241738699421018889L; | 
|  |  | 
|  |      | 
|  |  | 
|  |      */ | 
|  |     public PSVIAttrNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI, | 
|  |                           String qualifiedName, String localName) { | 
|  |         super(ownerDocument, namespaceURI, qualifiedName, localName); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |      */ | 
|  |     public PSVIAttrNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI, | 
|  |                           String qualifiedName) { | 
|  |         super(ownerDocument, namespaceURI, qualifiedName); | 
|  |     } | 
|  |  | 
|  |      | 
|  |     protected XSAttributeDeclaration fDeclaration = null; | 
|  |  | 
|  |      | 
|  |     protected XSTypeDefinition fTypeDecl = null; | 
|  |  | 
|  |      | 
|  |      * value in the original document, this is true; otherwise, it is false  */ | 
|  |     protected boolean fSpecified = true; | 
|  |  | 
|  |      | 
|  |     protected ValidatedInfo fValue = new ValidatedInfo(); | 
|  |  | 
|  |      | 
|  |     protected short fValidationAttempted = AttributePSVI.VALIDATION_NONE; | 
|  |  | 
|  |      | 
|  |     protected short fValidity = AttributePSVI.VALIDITY_NOTKNOWN; | 
|  |  | 
|  |      | 
|  |     protected StringList fErrorCodes = null; | 
|  |  | 
|  |      | 
|  |     protected StringList fErrorMessages = null; | 
|  |  | 
|  |      | 
|  |     protected String fValidationContext = null; | 
|  |  | 
|  |     // | 
|  |     // AttributePSVI methods | 
|  |     // | 
|  |  | 
|  |      | 
|  |  | 
|  |      */ | 
|  |     public ItemPSVI constant() { | 
|  |         return new AttributePSVImpl(true, this); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |      */ | 
|  |     public boolean isConstant() { | 
|  |         return false; | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     @SuppressWarnings("deprecation") | 
|  |     public String getSchemaDefault() { | 
|  |         return fDeclaration == null ? null : fDeclaration.getConstraintValue(); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     @Deprecated | 
|  |     public String getSchemaNormalizedValue() { | 
|  |         return fValue.getNormalizedValue(); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public boolean getIsSchemaSpecified() { | 
|  |         return fSpecified; | 
|  |     } | 
|  |  | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public short getValidationAttempted() { | 
|  |         return fValidationAttempted; | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public short getValidity() { | 
|  |         return fValidity; | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public StringList getErrorCodes() { | 
|  |         if (fErrorCodes != null) { | 
|  |             return fErrorCodes; | 
|  |         } | 
|  |         return StringListImpl.EMPTY_LIST; | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public StringList getErrorMessages() { | 
|  |         if (fErrorMessages != null) { | 
|  |             return fErrorMessages; | 
|  |         } | 
|  |         return StringListImpl.EMPTY_LIST; | 
|  |     } | 
|  |  | 
|  |      | 
|  |     public String getValidationContext() { | 
|  |         return fValidationContext; | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public XSTypeDefinition getTypeDefinition() { | 
|  |         return fTypeDecl; | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public XSSimpleTypeDefinition getMemberTypeDefinition() { | 
|  |         return fValue.getMemberTypeDefinition(); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public XSAttributeDeclaration getAttributeDeclaration() { | 
|  |         return fDeclaration; | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |  | 
|  |  | 
|  |      */ | 
|  |     public void setPSVI(AttributePSVI attr) { | 
|  |         this.fDeclaration = attr.getAttributeDeclaration(); | 
|  |         this.fValidationContext = attr.getValidationContext(); | 
|  |         this.fValidity = attr.getValidity(); | 
|  |         this.fValidationAttempted = attr.getValidationAttempted(); | 
|  |         this.fErrorCodes = attr.getErrorCodes(); | 
|  |         this.fErrorMessages = attr.getErrorMessages(); | 
|  |         this.fValue.copyFrom(attr.getSchemaValue()); | 
|  |         this.fTypeDecl = attr.getTypeDefinition(); | 
|  |         this.fSpecified = attr.getIsSchemaSpecified(); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |      */ | 
|  |     @Deprecated | 
|  |     public Object getActualNormalizedValue() { | 
|  |         return fValue.getActualValue(); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |      */ | 
|  |     @Deprecated | 
|  |     public short getActualNormalizedValueType() { | 
|  |         return fValue.getActualValueType(); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |      */ | 
|  |     @Deprecated | 
|  |     public ShortList getItemValueTypes() { | 
|  |         return fValue.getListValueTypes(); | 
|  |     } | 
|  |  | 
|  |      | 
|  |  | 
|  |      */ | 
|  |     public XSValue getSchemaValue() { | 
|  |         return fValue; | 
|  |     } | 
|  |  | 
|  |     // REVISIT: Forbid serialization of PSVI DOM until | 
|  |     // we support object serialization of grammars -- mrglavas | 
|  |  | 
|  |     private void writeObject(ObjectOutputStream out) | 
|  |         throws IOException { | 
|  |         throw new NotSerializableException(getClass().getName()); | 
|  |     } | 
|  |  | 
|  |     private void readObject(ObjectInputStream in) | 
|  |         throws IOException, ClassNotFoundException { | 
|  |         throw new NotSerializableException(getClass().getName()); | 
|  |     } | 
|  | } |