1 /* 2 * ASClassType.java 3 * 4 * Copyright (c) 2006 David Holroyd 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package uk.co.badgersinfoil.metaas.dom; 20 21 import java.util.List; 22 23 // TODO: add a createConstructor() ? 24 25 /** 26 * A handle on the definition of an ActionScript class. 27 * 28 * @see uk.co.badgersinfoil.metaas.ActionScriptFactory#newClass(String) 29 */ 30 public interface ASClassType extends ASType { 31 /** 32 * Returns the name of this ActionScript class' superclass, or null of 33 * the superclass is not specified. 34 */ 35 public String getSuperclass(); 36 37 /** 38 * Defines the name of the superclass for this ActionScript class. 39 */ 40 public void setSuperclass(String className); 41 42 /** 43 * Returns the list of names of the interfaces that this ActionScript 44 * class implements. 45 */ 46 public List getImplementedInterfaces(); 47 48 /** 49 * Adds an interface name to the list of interfaces which this 50 * ActionScript class implements. 51 */ 52 public void addImplementedInterface(String string); 53 54 /** 55 * Removes an interface name from the list of interfaces which this 56 * ActionScript class implements. 57 */ 58 public void removeImplementedInterface(String string); 59 60 /** 61 * Adds a new ActionScript field definition to this ActionScript class. 62 */ 63 public ASField newField(String name, Visibility visibility, String type); 64 65 /** 66 * Returns a reference to the ActionScript field with the given name, 67 * or null, if no such field exists. 68 */ 69 public ASField getField(String name); 70 71 /** 72 * Returns a list of {@link ASField} objects representing the 73 * fields this ActionScript class defines. 74 */ 75 public List getFields(); 76 77 /** 78 * Returns true if the class is defined with the <code>dynamic</code> 79 * modifier, and false otherwise. 80 */ 81 public boolean isDynamic(); 82 83 /** 84 * Returns true if the class is defined with the <code>final</code> 85 * modifier, and false otherwise. 86 */ 87 public boolean isFinal(); 88 89 /** 90 * Removes the named field from the list of fields which this 91 * ActionScript class defines. 92 */ 93 public void removeField(String name); 94 95 /** 96 * Adds or removes the <code>dynamic</code> modifer. 97 */ 98 public void setDynamic(boolean value); 99 100 /** 101 * Adds or removes the <code>final</code> modifer. 102 */ 103 public void setFinal(boolean value); 104 }