modificationattribute.java

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

JAVA
134
字号
/* * 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 *///---------------------------------------------------------------------------////  CVS Info//---------------------------------------------------------------------------//////  $Id: ModificationAttribute.java,v 1.2 2000/09/05 13:30:49 festor Exp $//  $Source: /local/resedas/CVS-Repository/CmisJavaApi/src/fr/dyade/cmis/api/types/ModificationAttribute.java,v $//---------------------------------------------------------------------------////  Todo//---------------------------------------------------------------------------//package fr.dyade.cmis.api.types;/**  *  Java representation of a ModificationAttribute ASN.1 datatype.  *  This type is indeed the sequence used in the set implementing  *  the ModificationList parameter of  SetRequest/Ind (SetArgument).  *  <p>  *  We provide 4 constant constructor to create each <code>ModificationAttribute</code>  *  <menu>  *     <li> MOD_REPLACE,   *     <li> MOD_ADDVALUE,  *     <li> MOD_REMOVE_VALUE,  *     <li> MOD_SET_TO_DEFAULT. In this case, no <code>AttributeValue</code> is necessary.  *  </menu>  * Remark: The internal tagging codes are Open Master fmk-c-api ones indeed. But they can be used by any other mapping.  *         We do not  introduce a "Default" case. Any java ModificationAttribute instance is garantied to have  *         a valid fModifyOperator operation field accessible using  getModifyOperator() method.    * @see ModifyOperator  * @version cvs $Id: ModificationAttribute.java,v 1.2 2000/09/05 13:30:49 festor Exp $  */public class ModificationAttribute extends Attribute {      /**	* Creates a new ModificationAttribute	*	*  ModifyOperator and Mask must be set afterwards, as well as corresponding	*  fields.	*/      private ModificationAttribute( AttributeId pId, Value pVal, short pMod ) {	 super(pId, pVal);	 fModifyOperator = pMod;      }      /** get modify operator code.	* @return return the modify operator code	* @see fr.dyade.cmis.api.types.ModifyOperator	*/      public final short getModifyOperator() {	 return fModifyOperator;      }      /** Implementation of X711's ASN1 ModifyOperator addValue 	* Convenient form using OID string dotted notation for attribute id.	*/      public static ModificationAttribute ADD_VALUE( String pIdDottedStr, Value pVal ) {	 return new ModificationAttribute(new AttributeId(pIdDottedStr), pVal, ModifyOperator.ADDVALUE_CODE);      }      /** Implementation of X711's ASN1 ModifyOperator replace 	* Convenient form using OID string dotted notation for attribute id.	*/      public static ModificationAttribute REPLACE( String pIdDottedStr, Value pVal ) {	 return new ModificationAttribute(new AttributeId(pIdDottedStr), pVal, ModifyOperator.REPLACE_CODE);      }      /** Implementation of X711's ASN1 ModifyOperator removeValue 	* Convenient form using OID string dotted notation for attribute id.	*/      public static ModificationAttribute REMOVE_VALUE( String pIdDottedStr, Value pVal ){	 return new ModificationAttribute(new AttributeId(pIdDottedStr), pVal, ModifyOperator.REMOVE_VALUE_CODE);      }      /** Implementation of X711's ASN1 ModifyOperator setToDefault 	* Convenient form using OID string dotted notation for attribute id.	*/      public static ModificationAttribute SET_TO_DEFAULT( String pIdDottedStr ){	 return new ModificationAttribute(new AttributeId(pIdDottedStr), null, ModifyOperator.SET_TO_DEFAULT_CODE);      }      /** Implementation of X711's ASN1 ModifyOperator addValue 	* Convenient form using OID string dotted notation for attribute id.	*/      public static ModificationAttribute ADD_VALUE(  AttributeId pId, Value pVal ) {	 return new ModificationAttribute(pId, pVal, ModifyOperator.ADDVALUE_CODE);      }      /** Implementation of X711's ASN1 ModifyOperator replace */      public static ModificationAttribute REPLACE( AttributeId pId, Value pVal ) {	 return new ModificationAttribute(pId, pVal, ModifyOperator.REPLACE_CODE);      }      /** Implementation of X711's ASN1 ModifyOperator removeValue */      public static ModificationAttribute REMOVE_VALUE( AttributeId pId, Value pVal ){	 return new ModificationAttribute(pId, pVal, ModifyOperator.REMOVE_VALUE_CODE);      }      /** Implementation of X711's ASN1 ModifyOperator setToDefault */      public static ModificationAttribute SET_TO_DEFAULT( AttributeId pId ){	 return new ModificationAttribute(pId, null, ModifyOperator.SET_TO_DEFAULT_CODE);      }      private short fModifyOperator;      public String toString() {	 String res=  ModifyOperator.toString(fModifyOperator)+":"+	    getAttributeId();	 Value v= getValue();	 /* value is not valid for SET_TO_DEFAULT */	 if (v!=null) {	    res += "="+v;	 }	 return res;      }} // ModificationAttribute

⌨️ 快捷键说明

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