AnyEscapedLocalRef.java :  » Web-Framework » anvil » anvil » core » Java Open Source

Java Open Source » Web Framework » anvil 
anvil » anvil » core » AnyEscapedLocalRef.java
/*
 * $Id: AnyEscapedLocalRef.java,v 1.4 2002/09/16 08:05:02 jkl Exp $
 *
 * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
 *
 * Use is subject to license terms, as defined in
 * Anvil Sofware License, Version 1.1. See LICENSE 
 * file, or http://njet.org/license-1.1.txt
 */
package anvil.core;

import anvil.script.Context;
import anvil.script.Type;
import anvil.script.ClassType;
import anvil.script.Scope;
import anvil.script.Module;
import anvil.script.ScriptException;
import anvil.java.util.BindingEnumeration;
import java.io.Writer;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Enumeration;
import org.apache.oro.text.regex.Pattern;
import anvil.script.StackFrame;


public final class AnyEscapedLocalRef extends AnyLocalRef
{
 
  protected int _depth;


  private AnyEscapedLocalRef() 
  {
  }

  public AnyEscapedLocalRef(StackFrame frame, int depth, int index) 
  {
    super(frame, index);
    _depth = depth;
  }
  
  
  public void setRef(Any value)
  {
    _frame.setLocal(_depth, _index, value);
  }
  
  
  public Any getRef()
  {
    return _frame.getLocal(_depth, _index);
  }
  
  
  public void serialize(Serializer serializer) 
     throws IOException 
  {
    if (serializer.register(this)) {
      return;
    }
    serializer.write('Q');
    serializer.write(_index);
    serializer.write(':');
    serializer.write(_depth);
    serializer.write(':');
    _frame.serialize(serializer);
  }

  
  public static final Any unserialize(Unserializer unserializer)
      throws UnserializationException
  {
    AnyEscapedLocalRef ref = new AnyEscapedLocalRef();
    unserializer.register(ref);
    ref._index = (int)unserializer.getLong();
    ref._depth = (int)unserializer.getLong();
    ref._frame = StackFrame.unserialize(unserializer, null, null, null);
    return ref;
  }


}

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.