GP-0: Fixing @Override warnings

This commit is contained in:
Ryan Kurtz 2025-05-29 06:16:20 -04:00
parent d4120b4b4d
commit a6cd5b5dbc
449 changed files with 2348 additions and 1276 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -41,6 +41,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#getLocationRepresentation(int)
*/
@Override
public String getLocationRepresentation(BigInteger bigIndex) {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -49,6 +50,7 @@ class FileByteBlock implements ByteBlock {
return null;
}
@Override
public int getMaxLocationRepresentationSize() {
return 8;
}
@ -56,6 +58,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#getIndexName()
*/
@Override
public String getIndexName() {
return "Bytes";
}
@ -63,6 +66,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#getLength()
*/
@Override
public BigInteger getLength() {
return BigInteger.valueOf(buf.length);
}
@ -70,6 +74,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#getByte(int)
*/
@Override
public byte getByte(BigInteger bigIndex) throws ByteBlockAccessException {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -81,6 +86,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#getShort(int)
*/
@Override
public short getShort(BigInteger bigIndex) throws ByteBlockAccessException {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -94,6 +100,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#getInt(int)
*/
@Override
public int getInt(BigInteger bigIndex) throws ByteBlockAccessException {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -107,6 +114,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#getLong(int)
*/
@Override
public long getLong(BigInteger bigIndex) throws ByteBlockAccessException {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -120,6 +128,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#setByte(int, byte)
*/
@Override
public void setByte(BigInteger bigIndex, byte value) throws ByteBlockAccessException {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -130,6 +139,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#setShort(int, short)
*/
@Override
public void setShort(BigInteger bigIndex, short value) throws ByteBlockAccessException {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -142,6 +152,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#setInt(int, int)
*/
@Override
public void setInt(BigInteger bigIndex, int value) throws ByteBlockAccessException {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -154,6 +165,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#setLong(int, long)
*/
@Override
public void setLong(BigInteger bigIndex, long value) throws ByteBlockAccessException {
int index = bigIndex.intValue();
if (index < buf.length) {
@ -167,6 +179,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#isEditable()
*/
@Override
public boolean isEditable() {
return false;
}
@ -174,6 +187,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#setBigEndian(boolean)
*/
@Override
public void setBigEndian(boolean bigEndian) {
if (this.bigEndian != bigEndian) {
this.bigEndian = bigEndian;
@ -184,6 +198,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#isBigEndian()
*/
@Override
public boolean isBigEndian() {
return bigEndian;
}
@ -191,6 +206,7 @@ class FileByteBlock implements ByteBlock {
/* (non-Javadoc)
* @see ghidra.app.plugin.core.format.ByteBlock#getAlignment(int)
*/
@Override
public int getAlignment(int radix) {
return 0;
}

View file

@ -1,13 +1,12 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -46,6 +45,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
/**
* Get the name of this formatter.
*/
@Override
public String getName() {
return "Address";
}
@ -54,6 +54,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
* Get the number of bytes to make a unit; in this case it
* takes 1 byte to make an Ascii value.
*/
@Override
public int getUnitByteSize() {
return 1;
}
@ -63,6 +64,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
* it returns a number from 0 to unit byte size - 1 indicating which
* byte the character position was obtained from.
*/
@Override
public int getByteOffset(ByteBlock block, int position) {
return 0;
}
@ -70,6 +72,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
/**
* Given the byte offset into a unit, get the column position.
*/
@Override
public int getColumnPosition(ByteBlock block, int byteOffset) {
return 0;
}
@ -78,6 +81,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
* Gets the number of characters required to display a
* unit.
*/
@Override
public int getDataUnitSymbolSize() {
return symbolSize;
}
@ -90,6 +94,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public String getDataRepresentation(ByteBlock block, BigInteger index)
throws ByteBlockAccessException {
@ -175,6 +180,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
/**
* Returns true if the formatter allows values to be changed.
*/
@Override
public boolean isEditable() {
return false;
}
@ -191,6 +197,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
* attempt to put a 'z' in a hex unit.
* block
*/
@Override
public boolean replaceValue(ByteBlock block, BigInteger index, int charPosition, char c) {
return false;
}
@ -198,6 +205,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
/**
* Get the number of characters separating units.
*/
@Override
public int getUnitDelimiterSize() {
return 0;
}
@ -207,6 +215,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
* multiple units shown as one entity. This format does not
* support groups.
*/
@Override
public int getGroupSize() {
return 0;
}
@ -216,6 +225,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
* support groups.
* @throws UnsupportedOperationException
*/
@Override
public void setGroupSize(int groupSize) {
throw new UnsupportedOperationException("groups are not supported");
}
@ -223,6 +233,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
/**
* @see ghidra.app.plugin.core.format.DataFormatModel#validateBytesPerLine(int)
*/
@Override
public boolean validateBytesPerLine(int bytesPerLine) {
return true;
}
@ -233,6 +244,7 @@ public class AddressFormatModel implements ProgramDataFormatModel {
* are added as a view to Memory Viewer are created via a Factory within their
* respective Formatter Plugin.
*/
@Override
public void setProgram(Program program) {
if (program == null) {
listing = null;
@ -247,10 +259,12 @@ public class AddressFormatModel implements ProgramDataFormatModel {
/* (non-Javadoc)
* @see ghidra.app.plugin.format.DataFormatModel#getHelpLocation()
*/
@Override
public HelpLocation getHelpLocation() {
return new HelpLocation("ByteViewerPlugin", "Address");
}
@Override
public void dispose() {
listing = null;
memory = null;

View file

@ -1,13 +1,12 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -35,6 +34,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
/**
* Get the name of this formatter.
*/
@Override
public String getName() {
return "Ascii";
}
@ -43,6 +43,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
* Get the number of bytes to make a unit; in this case it
* takes 1 byte to make an Ascii value.
*/
@Override
public int getUnitByteSize() {
return 1;
}
@ -52,6 +53,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
* it returns a number from 0 to unit byte size - 1 indicating which
* byte the character position was obtained from.
*/
@Override
public int getByteOffset(ByteBlock block, int position) {
return 0;
}
@ -59,6 +61,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
/**
* Given the byte offset into a unit, get the column position.
*/
@Override
public int getColumnPosition(ByteBlock block, int byteOffset) {
return 0;
}
@ -67,6 +70,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
* Gets the number of characters required to display a
* unit.
*/
@Override
public int getDataUnitSymbolSize() {
return symbolSize;
}
@ -79,6 +83,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public String getDataRepresentation(ByteBlock block, BigInteger index)
throws ByteBlockAccessException {
@ -99,6 +104,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
/**
* Returns true if the formatter allows values to be changed.
*/
@Override
public boolean isEditable() {
return true;
}
@ -117,6 +123,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public boolean replaceValue(ByteBlock block, BigInteger index, int charPosition, char c)
throws ByteBlockAccessException {
@ -141,6 +148,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
* support groups.
* @throws UnsupportedOperationException
*/
@Override
public int getGroupSize() {
return 0;
}
@ -150,6 +158,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
* support groups.
* @throws UnsupportedOperationException
*/
@Override
public void setGroupSize(int groupSize) {
throw new UnsupportedOperationException("groups are not supported");
}
@ -157,6 +166,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
/**
* Get the number of characters separating units.
*/
@Override
public int getUnitDelimiterSize() {
return 0;
}
@ -164,6 +174,7 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
/**
* @see ghidra.app.plugin.core.format.DataFormatModel#validateBytesPerLine(int)
*/
@Override
public boolean validateBytesPerLine(int bytesPerLine) {
return true;
}
@ -171,10 +182,12 @@ public class AsciiFormatModel implements UniversalDataFormatModel {
/* (non-Javadoc)
* @see ghidra.app.plugin.format.DataFormatModel#getHelpLocation()
*/
@Override
public HelpLocation getHelpLocation() {
return new HelpLocation("ByteViewerPlugin", "Ascii");
}
@Override
public void dispose() {
}

View file

@ -1,13 +1,12 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -36,6 +35,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
/**
* Get the name of this formatter.
*/
@Override
public String getName() {
return "Binary";
}
@ -44,6 +44,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
* Get the number of bytes to make a unit; in this case,
* returns 1.
*/
@Override
public int getUnitByteSize() {
return 1;
}
@ -53,6 +54,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
* it returns a number from 0 to unit byte size - 1 indicating which
* byte the character position was obtained from.
*/
@Override
public int getByteOffset(ByteBlock block, int position) {
return 0;
}
@ -60,6 +62,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
/**
* Given the byte offset into a unit, get the column position.
*/
@Override
public int getColumnPosition(ByteBlock block, int byteOffset) {
return 0;
}
@ -69,6 +72,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
* unit.
* @return 8 for number of characters in the binary representation.
*/
@Override
public int getDataUnitSymbolSize() {
return symbolSize;
}
@ -81,6 +85,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public String getDataRepresentation(ByteBlock block, BigInteger index)
throws ByteBlockAccessException {
@ -101,6 +106,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
/**
* Returns true to allow values to be changed.
*/
@Override
public boolean isEditable() {
return (true);
}
@ -119,6 +125,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public boolean replaceValue(ByteBlock block, BigInteger index, int charPosition, char c)
throws ByteBlockAccessException {
@ -152,6 +159,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
* multiple units shown as one entity. This format does not
* support groups.
*/
@Override
public int getGroupSize() {
return 1;
}
@ -161,6 +169,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
* support groups.
* @throws UnsupportedOperationException
*/
@Override
public void setGroupSize(int groupSize) {
throw new UnsupportedOperationException("groups are not supported");
}
@ -168,6 +177,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
/**
* Get the number of characters separating units.
*/
@Override
public int getUnitDelimiterSize() {
return 1;
}
@ -175,6 +185,7 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
/**
* @see ghidra.app.plugin.core.format.DataFormatModel#validateBytesPerLine(int)
*/
@Override
public boolean validateBytesPerLine(int bytesPerLine) {
return true;
}
@ -196,10 +207,12 @@ public class BinaryFormatModel implements UniversalDataFormatModel {
/* (non-Javadoc)
* @see ghidra.app.plugin.format.DataFormatModel#getHelpLocation()
*/
@Override
public HelpLocation getHelpLocation() {
return new HelpLocation("ByteViewerPlugin", "Binary");
}
@Override
public void dispose() {
// nothing to do
}

View file

@ -1,13 +1,12 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -50,6 +49,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
/**
* Get the name of this formatter.
*/
@Override
public String getName() {
return NAME;
}
@ -58,6 +58,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
* Get the number of bytes to make a unit; in this case,
* returns 1.
*/
@Override
public int getUnitByteSize() {
return unitByteSize;
}
@ -67,6 +68,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
* unit.
* @return 2 for number of characters in a unit
*/
@Override
public int getDataUnitSymbolSize() {
return symbolSize;
}
@ -74,6 +76,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
/**
* Get number of units in a group.
*/
@Override
public int getGroupSize() {
return groupSize;
}
@ -81,6 +84,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
/**
* Set the number of units in a group.
*/
@Override
public void setGroupSize(int groupSize) {
this.groupSize = groupSize;
unitByteSize = groupSize;
@ -98,6 +102,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
* Returns the byte used to generate the character at a given
* position.
*/
@Override
public int getByteOffset(ByteBlock block, int pos) {
if (prefixEnabled) {
if (pos <= 3) {
@ -117,6 +122,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
/**
* Given the byte offset into a unit, get the column position.
*/
@Override
public int getColumnPosition(ByteBlock block, int byteOffset) {
if (prefixEnabled) {
return byteOffset * 2 + 2;
@ -161,6 +167,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public String getDataRepresentation(ByteBlock block, BigInteger index)
throws ByteBlockAccessException {
@ -227,6 +234,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
/**
* Returns true to allow values to be changed.
*/
@Override
public boolean isEditable() {
return true;
}
@ -234,6 +242,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
/**
* Get the number of characters separating units for display purposes.
*/
@Override
public int getUnitDelimiterSize() {
return 1;
}
@ -252,6 +261,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public boolean replaceValue(ByteBlock block, BigInteger index, int charPosition, char c)
throws ByteBlockAccessException {
@ -287,6 +297,7 @@ public class HexFormatModel implements UniversalDataFormatModel {
/**
* @see ghidra.app.plugin.core.format.DataFormatModel#validateBytesPerLine(int)
*/
@Override
public boolean validateBytesPerLine(int bytesPerLine) {
return true;
}
@ -315,10 +326,12 @@ public class HexFormatModel implements UniversalDataFormatModel {
/* (non-Javadoc)
* @see ghidra.app.plugin.format.DataFormatModel#getHelpLocation()
*/
@Override
public HelpLocation getHelpLocation() {
return new HelpLocation("ByteViewerPlugin", "Hex");
}
@Override
public void dispose() {
}

View file

@ -1,13 +1,12 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -36,6 +35,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
/**
* Get the name of this formatter.
*/
@Override
public String getName() {
return "Integer";
}
@ -44,6 +44,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
* Get the number of bytes to make a unit; in this case,
* returns 4.
*/
@Override
public int getUnitByteSize() {
return 4;
}
@ -53,6 +54,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
* it returns a number from 0 to unit byte size - 1 indicating which
* byte the character position was obtained from.
*/
@Override
public int getByteOffset(ByteBlock block, int position) {
return 0;
@ -61,6 +63,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
/**
* Given the byte offset into a unit, get the column position.
*/
@Override
public int getColumnPosition(ByteBlock block, int byteOffset) {
return 0;
}
@ -70,6 +73,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
* unit.
* @return 4 for number of characters in the integer representation.
*/
@Override
public int getDataUnitSymbolSize() {
return symbolSize;
}
@ -82,6 +86,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public String getDataRepresentation(ByteBlock block, BigInteger index)
throws ByteBlockAccessException {
@ -97,6 +102,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
/**
* Returns false to allow no values to be changed.
*/
@Override
public boolean isEditable() {
return false;
}
@ -115,6 +121,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public boolean replaceValue(ByteBlock block, BigInteger index, int pos, char c)
throws ByteBlockAccessException {
@ -126,6 +133,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
* multiple units shown as one entity. This format does not
* support groups.
*/
@Override
public int getGroupSize() {
return 1;
}
@ -135,6 +143,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
* support groups.
* @throws UnsupportedOperationException
*/
@Override
public void setGroupSize(int groupSize) {
throw new UnsupportedOperationException("groups are not supported");
}
@ -142,6 +151,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
/**
* Get the number of characters separating units.
*/
@Override
public int getUnitDelimiterSize() {
return 1;
}
@ -149,6 +159,7 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
/**
* @see ghidra.app.plugin.core.format.DataFormatModel#validateBytesPerLine(int)
*/
@Override
public boolean validateBytesPerLine(int bytesPerLine) {
return bytesPerLine % 4 == 0;
}
@ -177,10 +188,12 @@ public class IntegerFormatModel implements UniversalDataFormatModel {
/* (non-Javadoc)
* @see ghidra.app.plugin.format.DataFormatModel#getHelpLocation()
*/
@Override
public HelpLocation getHelpLocation() {
return new HelpLocation("ByteViewerPlugin", "Integer");
}
@Override
public void dispose() {
// nothing to do
}

View file

@ -1,13 +1,12 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -36,6 +35,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
/**
* Get the name of this formatter.
*/
@Override
public String getName() {
return "Octal";
}
@ -44,6 +44,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
* Get the number of bytes to make a unit; in this case,
* returns 1.
*/
@Override
public int getUnitByteSize() {
return 1;
}
@ -53,6 +54,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
* it returns a number from 0 to unit byte size - 1 indicating which
* byte the character position was obtained from.
*/
@Override
public int getByteOffset(ByteBlock block, int position) {
return 0;
}
@ -60,6 +62,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
/**
* Given the byte offset into a unit, get the column position.
*/
@Override
public int getColumnPosition(ByteBlock block, int byteOffset) {
return 0;
}
@ -69,6 +72,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
* unit.
* @return 3 for number of characters in the octal representation.
*/
@Override
public int getDataUnitSymbolSize() {
return symbolSize;
}
@ -81,6 +85,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public String getDataRepresentation(ByteBlock block, BigInteger index)
throws ByteBlockAccessException {
@ -101,6 +106,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
/**
* Returns true to allow values to be changed.
*/
@Override
public boolean isEditable() {
return (true);
}
@ -119,6 +125,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
* @throws IndexOutOfBoundsException if index is not valid for the
* block
*/
@Override
public boolean replaceValue(ByteBlock block, BigInteger index, int charPosition, char c)
throws ByteBlockAccessException {
@ -162,6 +169,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
* multiple units shown as one entity. This format does not
* support groups.
*/
@Override
public int getGroupSize() {
return 1;
}
@ -171,6 +179,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
* support groups.
* @throws UnsupportedOperationException
*/
@Override
public void setGroupSize(int groupSize) {
throw new UnsupportedOperationException("groups are not supported");
}
@ -178,6 +187,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
/**
* Get the number of characters separating units.
*/
@Override
public int getUnitDelimiterSize() {
return 1;
}
@ -185,6 +195,7 @@ public class OctalFormatModel implements UniversalDataFormatModel {
/**
* @see ghidra.app.plugin.core.format.DataFormatModel#validateBytesPerLine(int)
*/
@Override
public boolean validateBytesPerLine(int bytesPerLine) {
return true;
}
@ -206,10 +217,12 @@ public class OctalFormatModel implements UniversalDataFormatModel {
/* (non-Javadoc)
* @see ghidra.app.plugin.format.DataFormatModel#getHelpLocation()
*/
@Override
public HelpLocation getHelpLocation() {
return new HelpLocation("ByteViewerPlugin", "Octal");
}
@Override
public void dispose() {
// nothing to do
}