mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-12-01 07:03:41 +01:00
953 lines
54 KiB
HTML
953 lines
54 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (version 1.7.0_07) on Tue Dec 04 01:00:50 CET 2012 -->
|
|
<title>StructureModifier</title>
|
|
<meta name="date" content="2012-12-04">
|
|
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="StructureModifier";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a name="navbar_top">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/StructureModifier.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../../index-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../../com/comphenix/protocol/reflect/PrettyPrinter.html" title="class in com.comphenix.protocol.reflect"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../../com/comphenix/protocol/reflect/VolatileField.html" title="class in com.comphenix.protocol.reflect"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../../index.html?com/comphenix/protocol/reflect/StructureModifier.html" target="_top">Frames</a></li>
|
|
<li><a href="StructureModifier.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_top");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li><a href="#field_summary">Field</a> | </li>
|
|
<li><a href="#constructor_summary">Constr</a> | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field_detail">Field</a> | </li>
|
|
<li><a href="#constructor_detail">Constr</a> | </li>
|
|
<li><a href="#method_detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip-navbar_top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="subTitle">com.comphenix.protocol.reflect</div>
|
|
<h2 title="Class StructureModifier" class="title">Class StructureModifier<TField></h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li>java.lang.Object</li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>com.comphenix.protocol.reflect.StructureModifier<TField></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>TField</code> - Type of the fields to retrieve.</dd></dl>
|
|
<dl>
|
|
<dt>Direct Known Subclasses:</dt>
|
|
<dd><a href="../../../../com/comphenix/protocol/reflect/compiler/CompiledStructureModifier.html" title="class in com.comphenix.protocol.reflect.compiler">CompiledStructureModifier</a></dd>
|
|
</dl>
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="strong">StructureModifier<TField></span>
|
|
extends java.lang.Object</pre>
|
|
<div class="block">Provides list-oriented access to the fields of a Minecraft packet.
|
|
<p>
|
|
Implemented by using reflection. Use a CompiledStructureModifier, if speed is essential.</div>
|
|
<dl><dt><span class="strong">Author:</span></dt>
|
|
<dd>Kristian</dd></dl>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- =========== FIELD SUMMARY =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="field_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Field Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
|
|
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Field and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected <a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#converter">converter</a></strong></code> </td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected boolean</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#customConvertHandling">customConvertHandling</a></strong></code> </td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected java.util.List<java.lang.reflect.Field></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#data">data</a></strong></code> </td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected java.util.Map<java.lang.reflect.Field,java.lang.Integer></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#defaultFields">defaultFields</a></strong></code> </td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected java.lang.Class</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#fieldType">fieldType</a></strong></code> </td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected java.util.Map<java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#subtypeCache">subtypeCache</a></strong></code> </td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected java.lang.Object</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#target">target</a></strong></code> </td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected java.lang.Class</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#targetType">targetType</a></strong></code> </td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected boolean</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#useStructureCompiler">useStructureCompiler</a></strong></code> </td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
|
|
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier</th>
|
|
<th class="colLast" scope="col">Constructor and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#StructureModifier()">StructureModifier</a></strong>()</code>
|
|
<div class="block">Consumers of this method should call "initialize".</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code> </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#StructureModifier(java.lang.Class)">StructureModifier</a></strong>(java.lang.Class targetType)</code>
|
|
<div class="block">Creates a structure modifier.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code> </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#StructureModifier(java.lang.Class, java.lang.Class, boolean)">StructureModifier</a></strong>(java.lang.Class targetType,
|
|
java.lang.Class superclassExclude,
|
|
boolean requireDefault)</code>
|
|
<div class="block">Creates a structure modifier.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code> </code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#StructureModifier(java.lang.Class, java.lang.Class, boolean, boolean)">StructureModifier</a></strong>(java.lang.Class targetType,
|
|
java.lang.Class superclassExclude,
|
|
boolean requireDefault,
|
|
boolean useStructureCompiler)</code>
|
|
<div class="block">Creates a structure modifier.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
|
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Method and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>java.util.List<java.lang.reflect.Field></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getFields()">getFields</a></strong>()</code>
|
|
<div class="block">Retrieves a list of the fields matching the constraints of this structure modifier.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>java.lang.Class</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getFieldType()">getFieldType</a></strong>()</code>
|
|
<div class="block">Retrieves the common type of each field.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected java.lang.Class<?></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getFieldType(int)">getFieldType</a></strong>(int index)</code>
|
|
<div class="block">Retrieve the type of a specified field.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>java.lang.Object</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getTarget()">getTarget</a></strong>()</code>
|
|
<div class="block">Retrieves the object we're currently modifying.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>java.lang.Class</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getTargetType()">getTargetType</a></strong>()</code>
|
|
<div class="block">Retrieves the type of the object we're modifying.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>java.util.List<<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#getValues()">getValues</a></strong>()</code>
|
|
<div class="block">Retrieve every value stored in the fields of the current type.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#initialize(java.lang.Class, java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter, java.util.Map)">initialize</a></strong>(java.lang.Class targetType,
|
|
java.lang.Class fieldType,
|
|
java.util.List<java.lang.reflect.Field> data,
|
|
java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
|
|
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> converter,
|
|
java.util.Map<java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>> subTypeCache)</code>
|
|
<div class="block">Initialize every field of this class.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#initialize(java.lang.Class, java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter, java.util.Map, boolean)">initialize</a></strong>(java.lang.Class targetType,
|
|
java.lang.Class fieldType,
|
|
java.util.List<java.lang.reflect.Field> data,
|
|
java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
|
|
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> converter,
|
|
java.util.Map<java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>> subTypeCache,
|
|
boolean useStructureCompiler)</code>
|
|
<div class="block">Initialize every field of this class.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#initialize(com.comphenix.protocol.reflect.StructureModifier)">initialize</a></strong>(<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> other)</code>
|
|
<div class="block">Initialize using the same field types.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#isReadOnly(int)">isReadOnly</a></strong>(int fieldIndex)</code>
|
|
<div class="block">Determine whether or not a field is read-only (final).</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#modify(int, com.google.common.base.Function)">modify</a></strong>(int fieldIndex,
|
|
com.google.common.base.Function<<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> select)</code>
|
|
<div class="block">Correctly modifies the value of a field.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#read(int)">read</a></strong>(int fieldIndex)</code>
|
|
<div class="block">Reads the value of a field given its index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#readSafely(int)">readSafely</a></strong>(int fieldIndex)</code>
|
|
<div class="block">Reads the value of a field if and ONLY IF it exists.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#setConverter(com.comphenix.protocol.reflect.EquivalentConverter)">setConverter</a></strong>(<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> converter)</code>
|
|
<div class="block">Set the current object converter.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>protected static void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#setFinalState(java.lang.reflect.Field, boolean)">setFinalState</a></strong>(java.lang.reflect.Field field,
|
|
boolean isReadOnly)</code>
|
|
<div class="block">Alter the final status of a field.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#setReadOnly(int, boolean)">setReadOnly</a></strong>(int fieldIndex,
|
|
boolean value)</code>
|
|
<div class="block">Set whether or not a field should be treated as read only.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#size()">size</a></strong>()</code>
|
|
<div class="block">Retrieve the number of readable types.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected <T> <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><T></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#withFieldType(java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter)">withFieldType</a></strong>(java.lang.Class fieldType,
|
|
java.util.List<java.lang.reflect.Field> filtered,
|
|
java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaults,
|
|
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><T> converter)</code>
|
|
<div class="block">Create a new structure modifier for the new field type.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#withTarget(java.lang.Object)">withTarget</a></strong>(java.lang.Object target)</code>
|
|
<div class="block">Retrieves a structure modifier of the same type for a different object target.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><T> <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><T></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#withType(java.lang.Class)">withType</a></strong>(java.lang.Class fieldType)</code>
|
|
<div class="block">Retrieves a structure modifier that only reads and writes fields of a given type.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><T> <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><T></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#withType(java.lang.Class, com.comphenix.protocol.reflect.EquivalentConverter)">withType</a></strong>(java.lang.Class fieldType,
|
|
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><T> converter)</code>
|
|
<div class="block">Retrieves a structure modifier that only reads and writes fields of a given type.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#write(int, TField)">write</a></strong>(int fieldIndex,
|
|
<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a> value)</code>
|
|
<div class="block">Writes the value of a field given its index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#writeDefaults()">writeDefaults</a></strong>()</code>
|
|
<div class="block">Sets all non-primitive fields to a more fitting default value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html#writeSafely(int, TField)">writeSafely</a></strong>(int fieldIndex,
|
|
<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a> value)</code>
|
|
<div class="block">Writes the value of a given field IF and ONLY if it exists.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.Object</h3>
|
|
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ============ FIELD DETAIL =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="field_detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Field Detail</h3>
|
|
<a name="targetType">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>targetType</h4>
|
|
<pre>protected java.lang.Class targetType</pre>
|
|
</li>
|
|
</ul>
|
|
<a name="target">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>target</h4>
|
|
<pre>protected java.lang.Object target</pre>
|
|
</li>
|
|
</ul>
|
|
<a name="converter">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>converter</h4>
|
|
<pre>protected <a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> converter</pre>
|
|
</li>
|
|
</ul>
|
|
<a name="fieldType">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>fieldType</h4>
|
|
<pre>protected java.lang.Class fieldType</pre>
|
|
</li>
|
|
</ul>
|
|
<a name="data">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>data</h4>
|
|
<pre>protected java.util.List<java.lang.reflect.Field> data</pre>
|
|
</li>
|
|
</ul>
|
|
<a name="defaultFields">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>defaultFields</h4>
|
|
<pre>protected java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields</pre>
|
|
</li>
|
|
</ul>
|
|
<a name="subtypeCache">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>subtypeCache</h4>
|
|
<pre>protected java.util.Map<java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>> subtypeCache</pre>
|
|
</li>
|
|
</ul>
|
|
<a name="customConvertHandling">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>customConvertHandling</h4>
|
|
<pre>protected boolean customConvertHandling</pre>
|
|
</li>
|
|
</ul>
|
|
<a name="useStructureCompiler">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>useStructureCompiler</h4>
|
|
<pre>protected boolean useStructureCompiler</pre>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor_detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Detail</h3>
|
|
<a name="StructureModifier(java.lang.Class)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>StructureModifier</h4>
|
|
<pre>public StructureModifier(java.lang.Class targetType)</pre>
|
|
<div class="block">Creates a structure modifier.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>targetType</code> - - the structure to modify.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="StructureModifier(java.lang.Class, java.lang.Class, boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>StructureModifier</h4>
|
|
<pre>public StructureModifier(java.lang.Class targetType,
|
|
java.lang.Class superclassExclude,
|
|
boolean requireDefault)</pre>
|
|
<div class="block">Creates a structure modifier.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>targetType</code> - - the structure to modify.</dd><dd><code>superclassExclude</code> - - a superclass to exclude.</dd><dd><code>requireDefault</code> - - whether or not we will be using writeDefaults().</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="StructureModifier(java.lang.Class, java.lang.Class, boolean, boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>StructureModifier</h4>
|
|
<pre>public StructureModifier(java.lang.Class targetType,
|
|
java.lang.Class superclassExclude,
|
|
boolean requireDefault,
|
|
boolean useStructureCompiler)</pre>
|
|
<div class="block">Creates a structure modifier.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>targetType</code> - - the structure to modify.</dd><dd><code>superclassExclude</code> - - a superclass to exclude.</dd><dd><code>requireDefault</code> - - whether or not we will be using writeDefaults().</dd><dd><code>useStructureCompiler</code> - - whether or not to automatically compile this structure modifier.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="StructureModifier()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>StructureModifier</h4>
|
|
<pre>protected StructureModifier()</pre>
|
|
<div class="block">Consumers of this method should call "initialize".</div>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method_detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a name="initialize(com.comphenix.protocol.reflect.StructureModifier)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>initialize</h4>
|
|
<pre>protected void initialize(<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> other)</pre>
|
|
<div class="block">Initialize using the same field types.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>other</code> - - information to set.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="initialize(java.lang.Class, java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter, java.util.Map)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>initialize</h4>
|
|
<pre>protected void initialize(java.lang.Class targetType,
|
|
java.lang.Class fieldType,
|
|
java.util.List<java.lang.reflect.Field> data,
|
|
java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
|
|
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> converter,
|
|
java.util.Map<java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>> subTypeCache)</pre>
|
|
<div class="block">Initialize every field of this class.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>targetType</code> - - type of the object we're reading and writing from.</dd><dd><code>fieldType</code> - - the common type of the fields we're modifying.</dd><dd><code>data</code> - - list of fields to modify.</dd><dd><code>defaultFields</code> - - list of fields that will be automatically initialized.</dd><dd><code>converter</code> - - converts between the common field type and the actual type the consumer expects.</dd><dd><code>subTypeCache</code> - - a structure modifier cache.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="initialize(java.lang.Class, java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter, java.util.Map, boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>initialize</h4>
|
|
<pre>protected void initialize(java.lang.Class targetType,
|
|
java.lang.Class fieldType,
|
|
java.util.List<java.lang.reflect.Field> data,
|
|
java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
|
|
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> converter,
|
|
java.util.Map<java.lang.Class,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a>> subTypeCache,
|
|
boolean useStructureCompiler)</pre>
|
|
<div class="block">Initialize every field of this class.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>targetType</code> - - type of the object we're reading and writing from.</dd><dd><code>fieldType</code> - - the common type of the fields we're modifying.</dd><dd><code>data</code> - - list of fields to modify.</dd><dd><code>defaultFields</code> - - list of fields that will be automatically initialized.</dd><dd><code>converter</code> - - converts between the common field type and the actual type the consumer expects.</dd><dd><code>subTypeCache</code> - - a structure modifier cache.</dd><dd><code>useStructureCompiler</code> - - whether or not to automatically compile this structure modifier.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="read(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>read</h4>
|
|
<pre>public <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a> read(int fieldIndex)
|
|
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
|
|
<div class="block">Reads the value of a field given its index.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Value of the field.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field doesn't exist, or it cannot be accessed under the current security contraints.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="readSafely(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>readSafely</h4>
|
|
<pre>public <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a> readSafely(int fieldIndex)
|
|
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
|
|
<div class="block">Reads the value of a field if and ONLY IF it exists.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Value of the field, or NULL if it doesn't exist.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field cannot be accessed under the current security contraints.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="isReadOnly(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>isReadOnly</h4>
|
|
<pre>public boolean isReadOnly(int fieldIndex)</pre>
|
|
<div class="block">Determine whether or not a field is read-only (final).</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>TRUE if the field by the given index is read-only, FALSE otherwise.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="setReadOnly(int, boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setReadOnly</h4>
|
|
<pre>public void setReadOnly(int fieldIndex,
|
|
boolean value)
|
|
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
|
|
<div class="block">Set whether or not a field should be treated as read only.
|
|
<p>
|
|
Note that changing the read-only state to TRUE will only work if the current
|
|
field was recently read-only or the current structure modifier hasn't been compiled yet.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field.</dd><dd><code>value</code> - - TRUE if this field should be read only, FALSE otherwise.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - If we cannot modify the read-only status.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="setFinalState(java.lang.reflect.Field, boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setFinalState</h4>
|
|
<pre>protected static void setFinalState(java.lang.reflect.Field field,
|
|
boolean isReadOnly)
|
|
throws java.lang.IllegalAccessException</pre>
|
|
<div class="block">Alter the final status of a field.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>field</code> - - the field to change.</dd><dd><code>isReadOnly</code> - - TRUE if the field should be read only, FALSE otherwise.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalAccessException</code> - If an error occured.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="write(int,java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="write(int, TField)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>write</h4>
|
|
<pre>public <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> write(int fieldIndex,
|
|
<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a> value)
|
|
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
|
|
<div class="block">Writes the value of a field given its index.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field.</dd><dd><code>value</code> - - new value of the field.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>This structure modifier - for chaining.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field doesn't exist, or it cannot be accessed under the current security contraints.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getFieldType(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getFieldType</h4>
|
|
<pre>protected java.lang.Class<?> getFieldType(int index)</pre>
|
|
<div class="block">Retrieve the type of a specified field.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>index</code> - - the index.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>The type of the given field.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="writeSafely(int,java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="writeSafely(int, TField)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>writeSafely</h4>
|
|
<pre>public <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> writeSafely(int fieldIndex,
|
|
<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a> value)
|
|
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
|
|
<div class="block">Writes the value of a given field IF and ONLY if it exists.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the potential field.</dd><dd><code>value</code> - - new value of the field.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>This structure modifer - for chaining.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field cannot be accessed under the current security contraints.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="modify(int, com.google.common.base.Function)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>modify</h4>
|
|
<pre>public <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> modify(int fieldIndex,
|
|
com.google.common.base.Function<<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>,<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> select)
|
|
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
|
|
<div class="block">Correctly modifies the value of a field.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldIndex</code> - - index of the field to modify.</dd><dd><code>select</code> - - the function that modifies the field value.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>This structure modifier - for chaining.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - The field cannot be accessed under the current security contraints.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="withType(java.lang.Class)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>withType</h4>
|
|
<pre>public <T> <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><T> withType(java.lang.Class fieldType)</pre>
|
|
<div class="block">Retrieves a structure modifier that only reads and writes fields of a given type.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldType</code> - - the type, or supertype, of every field to modify.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>A structure modifier for fields of this type.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="writeDefaults()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>writeDefaults</h4>
|
|
<pre>public <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> writeDefaults()
|
|
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
|
|
<div class="block">Sets all non-primitive fields to a more fitting default value. See <a href="../../../../com/comphenix/protocol/reflect/instances/DefaultInstances.html#getDefault(java.lang.Class)"><code>DefaultInstances.getDefault(Class)</code></a>.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>The current structure modifier - for chaining.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - If we're unable to write to the fields due to a security limitation.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="withType(java.lang.Class, com.comphenix.protocol.reflect.EquivalentConverter)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>withType</h4>
|
|
<pre>public <T> <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><T> withType(java.lang.Class fieldType,
|
|
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><T> converter)</pre>
|
|
<div class="block">Retrieves a structure modifier that only reads and writes fields of a given type.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldType</code> - - the type, or supertype, of every field to modify.</dd><dd><code>converter</code> - - converts objects into the given type.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>A structure modifier for fields of this type.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getFieldType()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getFieldType</h4>
|
|
<pre>public java.lang.Class getFieldType()</pre>
|
|
<div class="block">Retrieves the common type of each field.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Common type of each field.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getTargetType()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getTargetType</h4>
|
|
<pre>public java.lang.Class getTargetType()</pre>
|
|
<div class="block">Retrieves the type of the object we're modifying.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Type of the object.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getTarget()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getTarget</h4>
|
|
<pre>public java.lang.Object getTarget()</pre>
|
|
<div class="block">Retrieves the object we're currently modifying.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Object we're modifying.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="size()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>size</h4>
|
|
<pre>public int size()</pre>
|
|
<div class="block">Retrieve the number of readable types.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Readable types.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="withFieldType(java.lang.Class, java.util.List, java.util.Map, com.comphenix.protocol.reflect.EquivalentConverter)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>withFieldType</h4>
|
|
<pre>protected <T> <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><T> withFieldType(java.lang.Class fieldType,
|
|
java.util.List<java.lang.reflect.Field> filtered,
|
|
java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaults,
|
|
<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><T> converter)</pre>
|
|
<div class="block">Create a new structure modifier for the new field type.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>fieldType</code> - - common type of each field.</dd><dd><code>filtered</code> - - list of fields after filtering the original modifier.</dd><dd><code>defaults</code> - - list of default values after filtering the original.</dd><dd><code>converter</code> - - the new converter.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>A new structure modifier.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="withTarget(java.lang.Object)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>withTarget</h4>
|
|
<pre>public <a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="class in com.comphenix.protocol.reflect">StructureModifier</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> withTarget(java.lang.Object target)</pre>
|
|
<div class="block">Retrieves a structure modifier of the same type for a different object target.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>target</code> - - different target of the same type.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Structure modifier with the new target.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="setConverter(com.comphenix.protocol.reflect.EquivalentConverter)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setConverter</h4>
|
|
<pre>protected void setConverter(<a href="../../../../com/comphenix/protocol/reflect/EquivalentConverter.html" title="interface in com.comphenix.protocol.reflect">EquivalentConverter</a><<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> converter)</pre>
|
|
<div class="block">Set the current object converter. Should only be called during construction.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>converter</code> - - current object converter.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getFields()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getFields</h4>
|
|
<pre>public java.util.List<java.lang.reflect.Field> getFields()</pre>
|
|
<div class="block">Retrieves a list of the fields matching the constraints of this structure modifier.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>List of fields.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getValues()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>getValues</h4>
|
|
<pre>public java.util.List<<a href="../../../../com/comphenix/protocol/reflect/StructureModifier.html" title="type parameter in StructureModifier">TField</a>> getValues()
|
|
throws <a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></pre>
|
|
<div class="block">Retrieve every value stored in the fields of the current type.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Every field value.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - Unable to access one or all of the fields</dd></dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a name="navbar_bottom">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/StructureModifier.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../../index-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../../com/comphenix/protocol/reflect/PrettyPrinter.html" title="class in com.comphenix.protocol.reflect"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../../com/comphenix/protocol/reflect/VolatileField.html" title="class in com.comphenix.protocol.reflect"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../../index.html?com/comphenix/protocol/reflect/StructureModifier.html" target="_top">Frames</a></li>
|
|
<li><a href="StructureModifier.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li><a href="#field_summary">Field</a> | </li>
|
|
<li><a href="#constructor_summary">Constr</a> | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field_detail">Field</a> | </li>
|
|
<li><a href="#constructor_detail">Constr</a> | </li>
|
|
<li><a href="#method_detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip-navbar_bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
</body>
|
|
</html>
|