attributeerror.java

来自「CmisJavaApi」· Java 代码 · 共 201 行

JAVA
201
字号
/* * The contents of this file are subject to the Dyade Public License,  * as defined by the file DYADE_PUBLIC_LICENSE.TXT * * You may not use this file except in compliance with the License. You may * obtain a copy of the License on the Dyade web site (www.dyade.fr). * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific terms governing rights and limitations under the License. * * The Original Code is CmisJava API, including the java package  * fr.dyade.cmis, released September 5, 2000. * * The Initial Developer of the Original Code is Dyade. The Original Code and * portions created by Dyade are Copyright Bull and Copyright INRIA.  * All Rights Reserved. *//*      Copyright 1996-2000 by Institut National de Recherche en Informatique  *                             et en Automatique (INRIA) *          All rights reserved.  See COPYRIGHT in top-level directory. * *      Authors: Laurent Andrey, Eric Dillon, Olivier Festor *///---------------------------------------------------------------------------//////  File:          AttributeError.java//  Project:	   //  Author(s):     Eric DILLON//  Creation:      01.04.1998//  Last modified: 08.04.1998////---------------------------------------------------------------------------////---------------------------------------------------------------------------////  CVS Info//---------------------------------------------------------------------------//////  $Id: AttributeError.java,v 1.2 2000/09/05 13:30:28 festor Exp $//  $Source: /local/resedas/CVS-Repository/CmisJavaApi/src/fr/dyade/cmis/api/types/AttributeError.java,v $//---------------------------------------------------------------------------////  Todo//---------------------------------------------------------------------------//// check fAttributeValue. Current as Value. ANY in X711 spec...// Remark: Open Master fmk c api is using a "ismc_attribute_value" a typedef to ismc_value indeed.package fr.dyade.cmis.api.types;/**  * Java Representation for an <code>AttributeError</code> ASN.1 datatype.  * <p>  * @see fr.dyade.cmis.api.types.SetInfoStatus  * @see fr.dyade.cmis.api.types.GetInfoStatus  * @see fr.dyade.cmis.api.types.InfoStatus  * @see fr.dyade.cmis.api.types.ModifyOperator  * @version cvs $Id: AttributeError.java,v 1.2 2000/09/05 13:30:28 festor Exp $  */public class AttributeError   extends CMISType {            public final static short ERRORSTATUS_ACCESSDENIED = 2;      public final static short ERRORSTATUS_NOSUCH_ATTRIBUTE = 5;      public final static short ERRORSTATUS_INVALID_ATTRIBUTEVALUE = 6;      public final static short ERRORSTATUS_INVALID_OPERATION = 24;      public final static short ERRORSTATUS_INVALID_OPERATOR = 25;      private AttributeError(short pErrorStatus, AttributeId pAID) {	 fErrorStatus=pErrorStatus;	 fAttributeId=pAID;      }      private AttributeError(short pErrorStatus, AttributeId pAID, Value pValue ) {	 fErrorStatus=pErrorStatus;	 fAttributeId=pAID;	 fAttributeValue=pValue;      }      private AttributeError(short pErrorStatus, short pModifyOperator, AttributeId pAID) {	 fErrorStatus=pErrorStatus;	 fAttributeId=pAID;	 fModifyOperator=pModifyOperator;      }      private AttributeError(short pErrorStatus, short pModifyOperator, AttributeId pAID,  Value pAttributeValue) {	 fErrorStatus=pErrorStatus;	 fAttributeId=pAID;	 fModifyOperator=pModifyOperator;	 fAttributeValue=pAttributeValue;      }      /** Basic constructor.	* Dedicated to C level mappers which are responsible for	* properly fulfill the newly created object.	*/      private AttributeError() {}      public static final AttributeError ACCESSDENIED( AttributeId pAID ) {	 return new AttributeError(ERRORSTATUS_ACCESSDENIED, pAID);      }            public static final AttributeError NOSUCH_ATTRIBUTE( AttributeId pAID ) {	  return new AttributeError(ERRORSTATUS_NOSUCH_ATTRIBUTE, pAID);      }      public static final AttributeError INVALID_ATTRIBUTEVALUE( AttributeId pAID, Value pValue ) {	 return new AttributeError(ERRORSTATUS_INVALID_ATTRIBUTEVALUE, pAID, pValue);      }      public static final AttributeError INVALID_OPERATION( short pModifyOperator, AttributeId pAID, Value pValue ){	 return new AttributeError(ERRORSTATUS_INVALID_OPERATION, pModifyOperator, pAID, pValue);      }      public static final AttributeError INVALID_OPERATOR( short pModifyOperator, AttributeId pAID, Value pValue ){	 return new AttributeError(ERRORSTATUS_INVALID_OPERATOR, pModifyOperator, pAID, pValue);      }      public static final AttributeError INVALID_OPERATION( ModificationAttribute pMA ){	 return new AttributeError(ERRORSTATUS_INVALID_OPERATION, pMA.getModifyOperator(), 				   pMA.getAttributeId(), pMA.getValue());      }      public static final AttributeError INVALID_OPERATOR( ModificationAttribute pMA ){	 return new AttributeError(ERRORSTATUS_INVALID_OPERATOR, pMA.getModifyOperator(), 				   pMA.getAttributeId(), pMA.getValue());      }      /**	* Returns the current <code>ErrorStatus</code>. Following values are defined:	* <menu>	*    <li> <code>ERRORSTATUS_ACCESSDENIED</code>,	*    <li> <code>ERRORSTATUS_NOSUCH_ATTRIBUTE</code>,	*    <li> <code>ERRORSTATUS_INVALID_ATTRIBUTEVALUE</code>,	*    <li> <code>ERRORSTATUS_INVALID_OPERATION</code>,	*    <li> <code>ERRORSTATUS_INVALID_OPERATOR</code>.	* </menu>	* @return the <code>ErrorStatus</code> code.	*/      public final short getErrorStatus() {	 return fErrorStatus;      }       /**	* Returns the <code>ModifyOperator</code> used for related CMISRequest. Following values are defined:	* <menu>	*    <li> <code>ModifyOperator.REPLACE</code>,	*    <li> <code>ModifiyOperatorADDVALUES</code>,	*    <li> <code>ModifyOperator.REMOVE_VALUES</code>,	*    <li> <code>ModifyOperator.SET_TO_DEFAULT</code>.	* </menu>	* @return the <code>ModifyOperator</code> code.	* @see fr.dyade.cmis.api.types.ModifyOperator	*/      public final short getModifyOperator() {	 return fModifyOperator;      }            /**	* Returns the <code>AttributeId</code> that caused the Error.	* @return <code>AttributeId</code> related to the CMISError	*/      public final AttributeId getAttributeId() {	 return fAttributeId;      }            /**	* Returns the <code>Value</code> that caused the CMISError.	* @return the <code>Value</code> related to the CMISError.	*/      public final Value getAttributeValue() {	 return fAttributeValue;      }            /**	*   Returns a String for debugging purpose:	*	*/      public String toString() {	 String res;	 switch(fErrorStatus){	    case ERRORSTATUS_ACCESSDENIED:	       res= "ACCESSDENIED" ;	       break;	    case ERRORSTATUS_NOSUCH_ATTRIBUTE:	       res="NOSUCH_ATTRIBUTE";	       break;	    case ERRORSTATUS_INVALID_ATTRIBUTEVALUE:	       res="INVALID_ATTRIBUTEVALUE"; 	       break;	    case ERRORSTATUS_INVALID_OPERATION:	       res="INVALID_OPERATION";	       break;	    case ERRORSTATUS_INVALID_OPERATOR: 	       res= "INVALID_OPERATOR:"+ ModifyOperator.toString(fModifyOperator);	       break;	    default:	       res="Bad Error Status code ("+fErrorStatus+")";	 }	 res+=":"+ fAttributeId.toString();	 if (fAttributeValue!=null) {	    res+="="+fAttributeValue.toString();	 }	 return res;      }            private short fErrorStatus;      private AttributeId fAttributeId;      private Value fAttributeValue;      private short fModifyOperator;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?