001    package com.oxygenxml.validate.nvdl;
002    
003    import com.thaiopensource.validate.Schema;
004    
005    /**
006     * Action set for attributes.
007     * Consistes of two flags (attach, reject) and a list of schemas.
008     */
009    class AttributeActionSet {
010      /**
011       * Attach flag.
012       */
013      private boolean attach;
014      
015      /**
016       * Reject flag.
017       */
018      private boolean reject;
019      
020      /**
021       * Cancel nested actions flag.
022       */
023      private boolean cancelNestedActions;
024      
025      /**
026       * An array of schemas.
027       */
028      private Schema[] schemas = new Schema[0];
029    
030      /**
031       * Getter for the attach flag.
032       * @return attach.
033       */
034      boolean getAttach() {
035        return attach;
036      }
037    
038      /**
039       * Setter for the attach flag.
040       * 
041       * @param attach The new attach value.
042       */
043      void setAttach(boolean attach) {
044        this.attach = attach;
045      }
046    
047      /**
048       * Getter for the reject flag.
049       * @return reject.
050       */
051      boolean getReject() {
052        return reject;
053      }
054    
055      /**
056       * Setter for the reject flag.
057       * @param reject The new reject flag value.
058       */
059      void setReject(boolean reject) {
060        this.reject = reject;
061      }
062    
063      /**
064       * Getter for the cancel nested actions flag. 
065       */
066      boolean getCancelNestedActions() {
067        return cancelNestedActions;
068      }
069      
070      /**
071       * Set the cancel nested actions flag.
072       * @param cancelNestedActions The new value.
073       */
074      void setCancelNestedActions(boolean cancelNestedActions) {
075        this.cancelNestedActions = cancelNestedActions;
076      }
077      
078      /**
079       * Get the schemas array.
080       * @return The array of Schema objects.
081       */
082      Schema[] getSchemas() {
083        return schemas;
084      }
085    
086      /**
087       * Add a new Schema.
088       * @param schema The schema to be added.
089       */
090      void addSchema(Schema schema) {
091        Schema[] s = new Schema[schemas.length + 1];
092        System.arraycopy(schemas, 0, s, 0, schemas.length);
093        s[schemas.length] = schema;
094        schemas = s;
095      }
096    }