class WovenClassImpl extends java.lang.Object implements WovenClass, java.util.List<java.lang.String>
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
m_bytes |
private java.lang.String |
m_className |
private java.lang.Class |
m_definedClass |
private java.util.List<java.lang.String> |
m_imports |
private boolean |
m_isComplete |
private int |
m_state |
private BundleWiring |
m_wiring |
DEFINE_FAILED, DEFINED, TRANSFORMED, TRANSFORMING, TRANSFORMING_FAILED| Constructor and Description |
|---|
WovenClassImpl(java.lang.String className,
BundleWiring wiring,
byte[] bytes) |
| Modifier and Type | Method and Description |
|---|---|
(package private) byte[] |
_getBytes() |
void |
add(int i,
java.lang.String s) |
boolean |
add(java.lang.String s) |
boolean |
addAll(java.util.Collection<? extends java.lang.String> collection) |
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.String> collection) |
private void |
checkImport(java.lang.String s) |
void |
clear() |
(package private) void |
complete(java.lang.Class definedClass,
byte[] bytes,
java.util.List<java.lang.String> imports) |
(package private) void |
completeDefine(java.lang.Class definedClass) |
(package private) void |
completeImports(java.util.List<java.lang.String> imports) |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> collection) |
java.lang.String |
get(int i) |
BundleWiring |
getBundleWiring()
Returns the bundle wiring whose class loader will define the woven class.
|
byte[] |
getBytes()
Returns the class file bytes to be used to define the
named class. |
java.lang.String |
getClassName()
Returns the fully qualified name of the class being woven.
|
java.lang.Class<?> |
getDefinedClass()
Returns the class defined by this woven class.
|
java.util.List<java.lang.String> |
getDynamicImports()
Returns the list of dynamic import package descriptions to add to the
bundle wiring for this woven class. |
(package private) java.util.List<java.lang.String> |
getDynamicImportsInternal() |
java.security.ProtectionDomain |
getProtectionDomain()
Returns the protection domain to which the woven class will be assigned
when it is defined.
|
int |
getState()
Returns the current state of this woven class.
|
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
boolean |
isWeavingComplete()
Returns whether weaving is complete in this woven class.
|
java.util.Iterator<java.lang.String> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<java.lang.String> |
listIterator() |
java.util.ListIterator<java.lang.String> |
listIterator(int i) |
java.lang.String |
remove(int i) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> collection) |
boolean |
retainAll(java.util.Collection<?> collection) |
java.lang.String |
set(int i,
java.lang.String s) |
void |
setBytes(byte[] bytes)
Set the class file bytes to be used to define the
named class. |
void |
setState(int state) |
int |
size() |
java.util.List<java.lang.String> |
subList(int i,
int i1) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] ts) |
private final java.lang.String m_className
private final BundleWiring m_wiring
private byte[] m_bytes
private java.util.List<java.lang.String> m_imports
private java.lang.Class m_definedClass
private boolean m_isComplete
private int m_state
WovenClassImpl(java.lang.String className,
BundleWiring wiring,
byte[] bytes)
void complete(java.lang.Class definedClass,
byte[] bytes,
java.util.List<java.lang.String> imports)
void completeImports(java.util.List<java.lang.String> imports)
void completeDefine(java.lang.Class definedClass)
public byte[] getBytes()
WovenClassnamed class.
While in the WovenClass.TRANSFORMING state, this method returns a reference
to the class files byte array contained in this object. After leaving the
WovenClass.TRANSFORMING state, this woven class can no longer be
transformed and a copy of the class file byte array is returned.
getBytes in interface WovenClassnamed class.public void setBytes(byte[] bytes)
WovenClassnamed class. This method must not be
called outside invocations of the weave method by the framework.
While in the WovenClass.TRANSFORMING state, this method replaces the
reference to the array contained in this object with the specified array.
After leaving the WovenClass.TRANSFORMING state, this woven class can no
longer be transformed and this method will throw an
IllegalStateException.
setBytes in interface WovenClassbytes - The new classfile that will be used to define the
named class. The specified array
is retained by this object and the caller must not modify the
specified array.java.util.List<java.lang.String> getDynamicImportsInternal()
public java.util.List<java.lang.String> getDynamicImports()
WovenClassbundle wiring for this woven class. Changes
made to the returned list will be visible to later weaving hooks called with this object. The returned list must not be
modified outside invocations of the weave method by the framework.
After leaving the WovenClass.TRANSFORMING state, this woven class can no
longer be transformed and the returned list will be unmodifiable.
If the Java runtime environment supports permissions, any modification to
the returned list requires AdminPermission[bundle,WEAVE].
Additionally, any add or set modification requires
PackagePermission[package,IMPORT].
getDynamicImports in interface WovenClassIllegalArgumentException if a
malformed dynamic import package description is added.public boolean isWeavingComplete()
WovenClassisWeavingComplete in interface WovenClasstrue if state is WovenClass.DEFINED,
WovenClass.TRANSFORMING_FAILED or WovenClass.DEFINE_FAILED;
false otherwise.public java.lang.String getClassName()
WovenClassgetClassName in interface WovenClasspublic java.security.ProtectionDomain getProtectionDomain()
WovenClassgetProtectionDomain in interface WovenClassnull if no protection domain will
be assigned.public java.lang.Class<?> getDefinedClass()
WovenClassnull. Once weaving is
complete, this method will return the class
object if this woven class was used to define the class.getDefinedClass in interface WovenClassnull if
weaving is not complete, the class definition failed or this
woven class was not used to define the class.public BundleWiring getBundleWiring()
WovenClassgetBundleWiring in interface WovenClasspublic int size()
size in interface java.util.Collection<java.lang.String>size in interface java.util.List<java.lang.String>public boolean isEmpty()
isEmpty in interface java.util.Collection<java.lang.String>isEmpty in interface java.util.List<java.lang.String>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<java.lang.String>contains in interface java.util.List<java.lang.String>public java.util.Iterator<java.lang.String> iterator()
iterator in interface java.lang.Iterable<java.lang.String>iterator in interface java.util.Collection<java.lang.String>iterator in interface java.util.List<java.lang.String>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.String>toArray in interface java.util.List<java.lang.String>public <T> T[] toArray(T[] ts)
toArray in interface java.util.Collection<java.lang.String>toArray in interface java.util.List<java.lang.String>public boolean add(java.lang.String s)
add in interface java.util.Collection<java.lang.String>add in interface java.util.List<java.lang.String>private void checkImport(java.lang.String s)
public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<java.lang.String>remove in interface java.util.List<java.lang.String>public boolean containsAll(java.util.Collection<?> collection)
containsAll in interface java.util.Collection<java.lang.String>containsAll in interface java.util.List<java.lang.String>public boolean addAll(java.util.Collection<? extends java.lang.String> collection)
addAll in interface java.util.Collection<java.lang.String>addAll in interface java.util.List<java.lang.String>public boolean addAll(int i,
java.util.Collection<? extends java.lang.String> collection)
addAll in interface java.util.List<java.lang.String>public boolean removeAll(java.util.Collection<?> collection)
removeAll in interface java.util.Collection<java.lang.String>removeAll in interface java.util.List<java.lang.String>public boolean retainAll(java.util.Collection<?> collection)
retainAll in interface java.util.Collection<java.lang.String>retainAll in interface java.util.List<java.lang.String>public void clear()
clear in interface java.util.Collection<java.lang.String>clear in interface java.util.List<java.lang.String>public java.lang.String get(int i)
get in interface java.util.List<java.lang.String>public java.lang.String set(int i,
java.lang.String s)
set in interface java.util.List<java.lang.String>public void add(int i,
java.lang.String s)
add in interface java.util.List<java.lang.String>public java.lang.String remove(int i)
remove in interface java.util.List<java.lang.String>public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<java.lang.String>public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<java.lang.String>public java.util.ListIterator<java.lang.String> listIterator()
listIterator in interface java.util.List<java.lang.String>public java.util.ListIterator<java.lang.String> listIterator(int i)
listIterator in interface java.util.List<java.lang.String>public java.util.List<java.lang.String> subList(int i,
int i1)
subList in interface java.util.List<java.lang.String>byte[] _getBytes()
public int getState()
WovenClassA woven class can be in only one state at any time.
getState in interface WovenClassWovenClass.TRANSFORMING, WovenClass.TRANSFORMED,
WovenClass.DEFINED, WovenClass.TRANSFORMING_FAILED or
WovenClass.DEFINE_FAILED.public void setState(int state)